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

Unified 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, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/extension_install_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/extension_install_prompt.mm
===================================================================
--- chrome/browser/cocoa/extension_install_prompt.mm (revision 0)
+++ chrome/browser/cocoa/extension_install_prompt.mm (revision 0)
@@ -0,0 +1,50 @@
+// 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::ShowExtensionInstallPrompt(
+ Profile* profile, Delegate* delegate, Extension* extension, SkBitmap* icon,
+ const std::wstring& warning_text) {
+ NSAlert* alert = [[[NSAlert alloc] init] autorelease];
+ [alert addButtonWithTitle:l10n_util::GetNSString(
+ IDS_EXTENSION_PROMPT_INSTALL_BUTTON)];
+ [alert addButtonWithTitle:l10n_util::GetNSString(
+ IDS_EXTENSION_PROMPT_CANCEL_BUTTON)];
+ [alert setMessageText:l10n_util::GetNSStringF(
+ IDS_EXTENSION_PROMPT_HEADING, UTF8ToUTF16(extension->name()))];
+ [alert setInformativeText:base::SysWideToNSString(warning_text)];
+ [alert setAlertStyle:NSWarningAlertStyle];
+ [alert setIcon:gfx::SkBitmapToNSImage(*icon)];
+
+ if ([alert runModal] == NSAlertFirstButtonReturn) {
+ delegate->ContinueInstall();
+ } else {
+ delegate->AbortInstall();
+ }
+}
+
+void ExtensionInstallUI::ShowExtensionInstallError(const std::string& error) {
+ NSAlert* alert = [[[NSAlert alloc] init] autorelease];
+ [alert addButtonWithTitle:l10n_util::GetNSString(IDS_OK)];
+ [alert setMessageText:l10n_util::GetNSString(
+ IDS_EXTENSION_INSTALL_FAILURE_TITLE)];
+ [alert setInformativeText:base::SysUTF8ToNSString(error)];
+ [alert setAlertStyle:NSWarningAlertStyle];
+ [alert runModal];
+}
« 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