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

Unified Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 10452009: Improve the UI for disabling off-store extension install. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments, fixed tests Created 8 years, 7 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
Index: chrome/browser/extensions/extension_install_ui.cc
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index ad858d3eddf76b20c23a1bc3b63abc24acc3bc4f..bd6b96174fdbdb1049fa7c8a5a95e895c12253a0 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -123,13 +123,18 @@ void ExtensionInstallUI::Prompt::SetInlineInstallWebstoreData(
}
string16 ExtensionInstallUI::Prompt::GetDialogTitle() const {
+ int resource_id = kTitleIds[type_];
+
if (type_ == INSTALL_PROMPT) {
- return l10n_util::GetStringUTF16(extension_->is_app() ?
- IDS_EXTENSION_INSTALL_APP_PROMPT_TITLE :
- IDS_EXTENSION_INSTALL_EXTENSION_PROMPT_TITLE);
- } else {
- return l10n_util::GetStringUTF16(kTitleIds[type_]);
+ if (extension_->is_app())
+ resource_id = IDS_EXTENSION_INSTALL_APP_PROMPT_TITLE;
+ else if (extension_->is_theme())
+ resource_id = IDS_EXTENSION_INSTALL_THEME_PROMPT_TITLE;
+ else
+ resource_id = IDS_EXTENSION_INSTALL_EXTENSION_PROMPT_TITLE;
}
+
+ return l10n_util::GetStringUTF16(resource_id);
}
string16 ExtensionInstallUI::Prompt::GetHeading() const {
@@ -313,10 +318,14 @@ void ExtensionInstallUI::ConfirmInstall(Delegate* delegate,
delegate_ = delegate;
prompt_type_ = INSTALL_PROMPT;
- // We special-case themes to not show any confirm UI. Instead they are
- // immediately installed, and then we show an infobar (see OnInstallSuccess)
- // to allow the user to revert if they don't like it.
- if (extension->is_theme()) {
+ // In the Web Store, we special-case themes to not show any confirm UI.
+ // Instead they are immediately installed, and then we show an infobar (see
+ // OnInstallSuccess) to allow the user to revert if they don't like it.
+ //
+ // We don't do this off-store because we don't want websites to be able to
+ // clickjack people into installing themes. Even though it's not dangerous, it
+ // would be annoying.
+ if (extension->from_webstore() && extension->is_theme()) {
delegate->InstallUIProceed();
return;
}
« no previous file with comments | « chrome/browser/extensions/extension_install_ui.h ('k') | chrome/browser/extensions/extension_install_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698