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

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

Issue 333015: o Cleans up canonical extension_install_ui.cc to avoid #ifdefs when feasible.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/extension_install_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 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 "chrome/browser/extensions/extension_install_ui.h"
13 #include "chrome/common/extensions/extension.h"
14 #include "grit/browser_resources.h"
15 #include "grit/chromium_strings.h"
16 #include "grit/generated_resources.h"
17 #include "skia/ext/skia_utils_mac.h"
18
19 class Profile;
20
21 void ExtensionInstallUI::ShowExtensionInstallPrompt(
22 Profile* profile, Delegate* delegate, Extension* extension, SkBitmap* icon,
23 const std::wstring& warning_text) {
24 NSAlert* alert = [[[NSAlert alloc] init] autorelease];
25 [alert addButtonWithTitle:l10n_util::GetNSString(
26 IDS_EXTENSION_PROMPT_INSTALL_BUTTON)];
27 [alert addButtonWithTitle:l10n_util::GetNSString(
28 IDS_EXTENSION_PROMPT_CANCEL_BUTTON)];
29 [alert setMessageText:l10n_util::GetNSStringF(
30 IDS_EXTENSION_PROMPT_HEADING, UTF8ToUTF16(extension->name()))];
31 [alert setInformativeText:base::SysWideToNSString(warning_text)];
32 [alert setAlertStyle:NSWarningAlertStyle];
33 [alert setIcon:gfx::SkBitmapToNSImage(*icon)];
34
35 if ([alert runModal] == NSAlertFirstButtonReturn) {
36 delegate->ContinueInstall();
37 } else {
38 delegate->AbortInstall();
39 }
40 }
41
42 void ExtensionInstallUI::ShowExtensionInstallError(const std::string& error) {
43 NSAlert* alert = [[[NSAlert alloc] init] autorelease];
44 [alert addButtonWithTitle:l10n_util::GetNSString(IDS_OK)];
45 [alert setMessageText:l10n_util::GetNSString(
46 IDS_EXTENSION_INSTALL_FAILURE_TITLE)];
47 [alert setInformativeText:base::SysUTF8ToNSString(error)];
48 [alert setAlertStyle:NSWarningAlertStyle];
49 [alert runModal];
50 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/extension_install_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698