Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome/browser/cocoa/extension_install_prompt.mm

Issue 3332016: Add a confirmation prompt to app uninstallation on the ntp. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: fix layout on Windows, remove some old crap Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/dom_ui/app_launcher_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util_mac.h" 9 #include "app/l10n_util_mac.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
11 #include "base/sys_string_conversions.h" 11 #include "base/sys_string_conversions.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/extensions/extension_install_ui.h" 13 #include "chrome/browser/extensions/extension_install_ui.h"
14 #include "chrome/common/extensions/extension.h" 14 #include "chrome/common/extensions/extension.h"
15 #include "grit/browser_resources.h" 15 #include "grit/browser_resources.h"
16 #include "grit/chromium_strings.h" 16 #include "grit/chromium_strings.h"
17 #include "grit/generated_resources.h" 17 #include "grit/generated_resources.h"
18 #include "skia/ext/skia_utils_mac.h" 18 #include "skia/ext/skia_utils_mac.h"
19 19
20 class Profile; 20 class Profile;
21 21
22 void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl( 22 void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
23 Profile* profile, Delegate* delegate, Extension* extension, SkBitmap* icon, 23 Profile* profile, Delegate* delegate, Extension* extension, SkBitmap* icon,
24 const string16& warning_text, ExtensionInstallUI::PromptType type) { 24 ExtensionInstallUI::PromptType type) {
25 NSAlert* alert = [[[NSAlert alloc] init] autorelease]; 25 NSAlert* alert = [[[NSAlert alloc] init] autorelease];
26 26
27 NSButton* continueButton = [alert addButtonWithTitle:l10n_util::GetNSString( 27 NSButton* continueButton = [alert addButtonWithTitle:l10n_util::GetNSString(
28 ExtensionInstallUI::kButtonIds[type])]; 28 ExtensionInstallUI::kButtonIds[type])];
29 // Clear the key equivalent (currently 'Return') because cancel is the default 29 // Clear the key equivalent (currently 'Return') because cancel is the default
30 // button. 30 // button.
31 [continueButton setKeyEquivalent:@""]; 31 [continueButton setKeyEquivalent:@""];
32 32
33 NSButton* cancelButton = [alert addButtonWithTitle:l10n_util::GetNSString( 33 NSButton* cancelButton = [alert addButtonWithTitle:l10n_util::GetNSString(
34 IDS_CANCEL)]; 34 IDS_CANCEL)];
35 [cancelButton setKeyEquivalent:@"\r"]; 35 [cancelButton setKeyEquivalent:@"\r"];
36 36
37 [alert setMessageText:l10n_util::GetNSStringF( 37 [alert setMessageText:l10n_util::GetNSStringF(
38 ExtensionInstallUI::kHeadingIds[type], 38 ExtensionInstallUI::kHeadingIds[type],
39 UTF8ToUTF16(extension->name()))]; 39 UTF8ToUTF16(extension->name()))];
40 [alert setInformativeText:base::SysUTF16ToNSString(warning_text)];
41 [alert setAlertStyle:NSWarningAlertStyle]; 40 [alert setAlertStyle:NSWarningAlertStyle];
42 [alert setIcon:gfx::SkBitmapToNSImage(*icon)]; 41 [alert setIcon:gfx::SkBitmapToNSImage(*icon)];
43 42
44 if ([alert runModal] == NSAlertFirstButtonReturn) { 43 if ([alert runModal] == NSAlertFirstButtonReturn) {
45 delegate->InstallUIProceed(false); 44 delegate->InstallUIProceed(false);
46 } else { 45 } else {
47 delegate->InstallUIAbort(); 46 delegate->InstallUIAbort();
48 } 47 }
49 } 48 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/dom_ui/app_launcher_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698