summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 23:08:38 +0000
committerpam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 23:08:38 +0000
commitc21b90496d356e5d8e56231dc8c4d4962a67f117 (patch)
tree675b7a4381bbeb547ddb7f15c68e1af00b88bc79 /chrome
parent079037f7dfbf8bbc4d5110f082310c10900b5320 (diff)
downloadchromium_src-c21b90496d356e5d8e56231dc8c4d4962a67f117.zip
chromium_src-c21b90496d356e5d8e56231dc8c4d4962a67f117.tar.gz
chromium_src-c21b90496d356e5d8e56231dc8c4d4962a67f117.tar.bz2
Make extension install UI text on Mac match Windows version. Still to come if
possible: coloring the "severe" warning red, applying a style to the rest of the text, and changing the default warning icon to the extension's install_icon. Remove dead function declaration, no longer used. BUG=19654 TEST=install an extension on Mac, observe dialog Review URL: http://codereview.chromium.org/174498 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24553 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/location_bar_view_mac.h1
-rw-r--r--chrome/browser/extensions/extension_install_ui.cc42
2 files changed, 34 insertions, 9 deletions
diff --git a/chrome/browser/cocoa/location_bar_view_mac.h b/chrome/browser/cocoa/location_bar_view_mac.h
index 226def8..646d31e 100644
--- a/chrome/browser/cocoa/location_bar_view_mac.h
+++ b/chrome/browser/cocoa/location_bar_view_mac.h
@@ -41,7 +41,6 @@ class LocationBarViewMac : public AutocompleteEditController,
virtual void AcceptInputWithDisposition(WindowOpenDisposition disposition);
virtual void FocusLocation();
virtual void FocusSearch();
- virtual void UpdateFeedIcon() { /* http://crbug.com/8832 */ }
virtual void UpdatePageActions() { /* http://crbug.com/12281 */ }
virtual void SaveStateToContents(TabContents* contents);
virtual void Revert();
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index 9435441..144ea78f 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -8,6 +8,7 @@
#include "app/l10n_util.h"
#include "base/file_util.h"
+#include "base/rand_util.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/extensions/theme_preview_infobar_delegate.h"
@@ -15,6 +16,7 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/extensions/extension.h"
#include "grit/chromium_strings.h"
+#include "grit/generated_resources.h"
#if defined(OS_WIN)
#include "app/win_util.h"
@@ -53,16 +55,40 @@ void ExtensionInstallUI::ConfirmInstall(Delegate* delegate,
// TODO(port): Implement nicer UI.
// Using CoreFoundation to do this dialog is unimaginably lame but will do
// until the UI is redone.
- scoped_cftyperef<CFStringRef> product_name(
- base::SysWideToCFStringRef(l10n_util::GetString(IDS_PRODUCT_NAME)));
+ scoped_cftyperef<CFStringRef> confirm_title(base::SysWideToCFStringRef(
+ l10n_util::GetString(IDS_EXTENSION_PROMPT_TITLE)));
+
+ // Build the confirmation prompt, including a heading, a random humorous
+ // warning, and a severe warning.
+ const string16& confirm_format(ASCIIToUTF16("$1\n\n$2\n\n$3"));
+ std::vector<string16> subst;
+ subst.push_back(l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_HEADING,
+ UTF8ToUTF16(extension->name())));
+ string16 warnings[] = {
+ l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_1),
+ l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_2),
+ l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_3)
+ };
+ subst.push_back(warnings[base::RandInt(0, arraysize(warnings) - 1)]);
+ subst.push_back(l10n_util::GetStringUTF16(
+ IDS_EXTENSION_PROMPT_WARNING_SEVERE));
+ scoped_cftyperef<CFStringRef> confirm_prompt(base::SysUTF16ToCFStringRef(
+ ReplaceStringPlaceholders(confirm_format, subst, NULL)));
+
+ scoped_cftyperef<CFStringRef> confirm_cancel(base::SysWideToCFStringRef(
+ l10n_util::GetString(IDS_EXTENSION_PROMPT_CANCEL_BUTTON)));
+
CFOptionFlags response;
if (kCFUserNotificationAlternateResponse == CFUserNotificationDisplayAlert(
- 0, kCFUserNotificationCautionAlertLevel, NULL, NULL, NULL,
- product_name,
- CFSTR("Are you sure you want to install this extension?\n\n"
- "This is a temporary message and it will be removed when "
- "extensions UI is finalized."),
- NULL, CFSTR("Cancel"), NULL, &response)) {
+ 0, kCFUserNotificationCautionAlertLevel,
+ NULL, // TODO(port): show the install_icon instead of a default.
+ NULL, NULL, // Sound URL, localization URL.
+ confirm_title,
+ confirm_prompt,
+ NULL, // Default button.
+ confirm_cancel,
+ NULL, // Other button.
+ &response)) {
delegate->AbortInstall();
} else {
delegate->ContinueInstall();