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

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

Issue 6269009: Move loose extension files in c/b/ui/cocoa/ into the extensions/ subdir... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import <Cocoa/Cocoa.h>
6
7 #include <string>
8
9 #include "app/l10n_util_mac.h"
10 #include "app/resource_bundle.h"
11 #include "base/sys_string_conversions.h"
12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/extensions/extension_install_ui.h"
14 #include "chrome/common/extensions/extension.h"
15 #include "grit/browser_resources.h"
16 #include "grit/chromium_strings.h"
17 #include "grit/generated_resources.h"
18 #include "skia/ext/skia_utils_mac.h"
19
20 class Profile;
21
22 void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
23 Profile* profile,
24 Delegate* delegate,
25 const Extension* extension,
26 SkBitmap* icon,
27 ExtensionInstallUI::PromptType type) {
28 NSAlert* alert = [[[NSAlert alloc] init] autorelease];
29
30 NSButton* continueButton = [alert addButtonWithTitle:l10n_util::GetNSString(
31 ExtensionInstallUI::kButtonIds[type])];
32 // Clear the key equivalent (currently 'Return') because cancel is the default
33 // button.
34 [continueButton setKeyEquivalent:@""];
35
36 NSButton* cancelButton = [alert addButtonWithTitle:l10n_util::GetNSString(
37 IDS_CANCEL)];
38 [cancelButton setKeyEquivalent:@"\r"];
39
40 [alert setMessageText:l10n_util::GetNSStringF(
41 ExtensionInstallUI::kHeadingIds[type],
42 UTF8ToUTF16(extension->name()))];
43 [alert setAlertStyle:NSWarningAlertStyle];
44 [alert setIcon:gfx::SkBitmapToNSImage(*icon)];
45
46 if ([alert runModal] == NSAlertFirstButtonReturn) {
47 delegate->InstallUIProceed();
48 } else {
49 delegate->InstallUIAbort();
50 }
51 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_ui.cc ('k') | chrome/browser/ui/cocoa/extension_installed_bubble_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698