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

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

Issue 12319131: Update extensions with Drag-and-Drop in extension settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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/browser/extensions/extension_install_prompt.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_install_prompt.cc
diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc
index cacb466cc16886325b9b52679c2cfdfd79115ed3..186030fbff65d6b21996008ef469899a863efd46 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -58,6 +58,7 @@ static const int kTitleIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
IDS_EXTENSION_PERMISSIONS_PROMPT_TITLE,
IDS_EXTENSION_EXTERNAL_INSTALL_PROMPT_TITLE,
IDS_EXTENSION_POST_INSTALL_PERMISSIONS_PROMPT_TITLE,
+ IDS_EXTENSION_UPDATE_PROMPT_TITLE,
Matt Perry 2013/02/27 01:21:46 Let's not add a new prompt type. We should do what
Joe Thomas 2013/02/27 20:55:38 Done.
};
static const int kHeadingIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
IDS_EXTENSION_INSTALL_PROMPT_HEADING,
@@ -67,6 +68,7 @@ static const int kHeadingIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
IDS_EXTENSION_PERMISSIONS_PROMPT_HEADING,
0, // External installs use different strings for extensions/apps.
IDS_EXTENSION_POST_INSTALL_PERMISSIONS_PROMPT_HEADING,
+ IDS_EXTENSION_UPDATE_PROMPT_HEADING,
};
static const int kButtons[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL,
@@ -76,6 +78,7 @@ static const int kButtons[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL,
ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL,
ui::DIALOG_BUTTON_CANCEL,
+ ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL,
};
static const int kAcceptButtonIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
IDS_EXTENSION_PROMPT_INSTALL_BUTTON,
@@ -85,6 +88,7 @@ static const int kAcceptButtonIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
IDS_EXTENSION_PROMPT_PERMISSIONS_BUTTON,
0, // External installs use different strings for extensions/apps.
0,
+ IDS_EXTENSION_PROMPT_UPDATE_BUTTON,
};
static const int kAbortButtonIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
0, // These all use the platform's default cancel label.
@@ -94,6 +98,7 @@ static const int kAbortButtonIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
IDS_EXTENSION_PROMPT_PERMISSIONS_ABORT_BUTTON,
IDS_EXTENSION_EXTERNAL_INSTALL_PROMPT_ABORT_BUTTON,
IDS_CLOSE,
+ 0,
};
static const int kPermissionsHeaderIds[
ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
@@ -104,6 +109,7 @@ static const int kPermissionsHeaderIds[
IDS_EXTENSION_PROMPT_WANTS_ACCESS_TO,
IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO,
IDS_EXTENSION_PROMPT_CAN_ACCESS,
+ IDS_EXTENSION_PROMPT_WILL_NOW_HAVE_ACCESS_TO,
};
static const int kOAuthHeaderIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
IDS_EXTENSION_PROMPT_OAUTH_HEADER,
@@ -115,6 +121,7 @@ static const int kOAuthHeaderIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
// we need to update FetchOAuthIssueAdviceIfNeeded.
0,
0,
+ IDS_EXTENSION_PROMPT_OAUTH_UPDATE_HEADER,
};
// Size of extension icon in top left of dialog.
@@ -566,6 +573,17 @@ void ExtensionInstallPrompt::ReviewPermissions(Delegate* delegate,
LoadImageIfNeeded();
}
+void ExtensionInstallPrompt::ConfirmUpdate(Delegate* delegate,
+ const Extension* extension) {
+ DCHECK(ui_loop_ == MessageLoop::current());
+ extension_ = extension;
+ permissions_ = extension->GetActivePermissions();
+ delegate_ = delegate;
+ prompt_.set_type(UPDATE_PROMPT);
+
+ LoadImageIfNeeded();
+}
+
void ExtensionInstallPrompt::OnInstallSuccess(const Extension* extension,
SkBitmap* icon) {
extension_ = extension;
@@ -679,7 +697,8 @@ void ExtensionInstallPrompt::ShowConfirmation() {
case INLINE_INSTALL_PROMPT:
case EXTERNAL_INSTALL_PROMPT:
case INSTALL_PROMPT:
- case POST_INSTALL_PERMISSIONS_PROMPT: {
+ case POST_INSTALL_PERMISSIONS_PROMPT:
+ case UPDATE_PROMPT: {
prompt_.set_extension(extension_);
prompt_.set_icon(gfx::Image::CreateFrom1xBitmap(icon_));
break;
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698