<commit_before>// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import <Cocoa/Cocoa.h>

#include <string>

#include "app/l10n_util_mac.h"
#include "app/resource_bundle.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/common/extensions/extension.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "skia/ext/skia_utils_mac.h"

class Profile;

void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
    Profile* profile, Delegate* delegate, Extension* extension, SkBitmap* icon,
    const std::wstring& warning_text, bool is_uninstall) {
  NSAlert* alert = [[[NSAlert alloc] init] autorelease];
  [alert addButtonWithTitle:l10n_util::GetNSString(
      is_uninstall ? IDS_EXTENSION_PROMPT_UNINSTALL_BUTTON :
                     IDS_EXTENSION_PROMPT_INSTALL_BUTTON)];
  [alert addButtonWithTitle:l10n_util::GetNSString(
      IDS_EXTENSION_PROMPT_CANCEL_BUTTON)];
  [alert setMessageText:l10n_util::GetNSStringF(
       is_uninstall ? IDS_EXTENSION_UNINSTALL_PROMPT_HEADING :
                      IDS_EXTENSION_INSTALL_PROMPT_HEADING,
       UTF8ToUTF16(extension->name()))];
  [alert setInformativeText:base::SysWideToNSString(warning_text)];
  [alert setAlertStyle:NSWarningAlertStyle];<commit_msg>Makes 'Cancel' the default button for extension install/uninstall confirmation dialogs.<commit_after>// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import <Cocoa/Cocoa.h>

#include <string>

#include "app/l10n_util_mac.h"
#include "app/resource_bundle.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/common/extensions/extension.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "skia/ext/skia_utils_mac.h"

class Profile;

void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
    Profile* profile, Delegate* delegate, Extension* extension, SkBitmap* icon,
    const std::wstring& warning_text, bool is_uninstall) {
  NSAlert* alert = [[[NSAlert alloc] init] autorelease];

  NSButton* continueButton = [alert addButtonWithTitle:l10n_util::GetNSString(
      is_uninstall ? IDS_EXTENSION_PROMPT_UNINSTALL_BUTTON :
                     IDS_EXTENSION_PROMPT_INSTALL_BUTTON)];
  // Clear the key equivalent (currently 'Return') because cancel is the default
  // button.
  [continueButton setKeyEquivalent:@""];

  NSButton* cancelButton = [alert addButtonWithTitle:l10n_util::GetNSString(
      IDS_EXTENSION_PROMPT_CANCEL_BUTTON)];
  [cancelButton setKeyEquivalent:@"\r"];

  [alert setMessageText:l10n_util::GetNSStringF(
       is_uninstall ? IDS_EXTENSION_UNINSTALL_PROMPT_HEADING :
                      IDS_EXTENSION_INSTALL_PROMPT_HEADING,
       UTF8ToUTF16(extension->name()))];
  [alert setInformativeText:base::SysWideToNSString(warning_text)];
  [alert setAlertStyle:NSWarningAlertStyle];
{'fraction_non_alphanumeric': 0.1007105344454742, 'fraction_numerical': 0.009267840593141797, 'mean_word_length': 5.336594911937378, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6639550', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1037, 'n_words': 212}