Index: chrome/browser/extensions/extension_install_prompt.cc |
=================================================================== |
--- chrome/browser/extensions/extension_install_prompt.cc (revision 179321) |
+++ chrome/browser/extensions/extension_install_prompt.cc (working copy) |
@@ -54,6 +54,7 @@ |
IDS_EXTENSION_RE_ENABLE_PROMPT_TITLE, |
IDS_EXTENSION_PERMISSIONS_PROMPT_TITLE, |
IDS_EXTENSION_EXTERNAL_INSTALL_PROMPT_TITLE, |
+ IDS_EXTENSION_POST_INSTALL_PERMISSIONS_PROMPT_TITLE, |
}; |
static const int kHeadingIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { |
IDS_EXTENSION_INSTALL_PROMPT_HEADING, |
@@ -62,7 +63,17 @@ |
IDS_EXTENSION_RE_ENABLE_PROMPT_HEADING, |
IDS_EXTENSION_PERMISSIONS_PROMPT_HEADING, |
0, // External installs use different strings for extensions/apps. |
+ IDS_EXTENSION_POST_INSTALL_PERMISSIONS_PROMPT_HEADING, |
}; |
+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_OK | ui::DIALOG_BUTTON_CANCEL, |
+ ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL, |
+ ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL, |
+ ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL, |
+ ui::DIALOG_BUTTON_CANCEL, |
+}; |
static const int kAcceptButtonIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { |
IDS_EXTENSION_PROMPT_INSTALL_BUTTON, |
IDS_EXTENSION_PROMPT_INSTALL_BUTTON, |
@@ -70,6 +81,7 @@ |
IDS_EXTENSION_PROMPT_RE_ENABLE_BUTTON, |
IDS_EXTENSION_PROMPT_PERMISSIONS_BUTTON, |
0, // External installs use different strings for extensions/apps. |
+ 0, |
}; |
static const int kAbortButtonIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { |
0, // These all use the platform's default cancel label. |
@@ -78,6 +90,7 @@ |
0, |
IDS_EXTENSION_PROMPT_PERMISSIONS_ABORT_BUTTON, |
IDS_EXTENSION_EXTERNAL_INSTALL_PROMPT_ABORT_BUTTON, |
+ IDS_CLOSE, |
}; |
static const int kPermissionsHeaderIds[ |
ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { |
@@ -87,6 +100,7 @@ |
IDS_EXTENSION_PROMPT_WILL_NOW_HAVE_ACCESS_TO, |
IDS_EXTENSION_PROMPT_WANTS_ACCESS_TO, |
IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO, |
+ IDS_EXTENSION_PROMPT_CAN_ACCESS, |
}; |
static const int kOAuthHeaderIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = { |
IDS_EXTENSION_PROMPT_OAUTH_HEADER, |
@@ -97,6 +111,7 @@ |
// TODO(mpcomplete): Do we need this for external install UI? If we do, |
// we need to update FetchOAuthIssueAdviceIfNeeded. |
0, |
+ 0, |
}; |
// Size of extension icon in top left of dialog. |
@@ -244,6 +259,10 @@ |
} |
} |
+int ExtensionInstallPrompt::Prompt::GetDialogButtons() const { |
+ return kButtons[type_]; |
+} |
+ |
string16 ExtensionInstallPrompt::Prompt::GetAcceptButtonLabel() const { |
if (type_ == EXTERNAL_INSTALL_PROMPT) { |
int id = -1; |
@@ -529,6 +548,17 @@ |
LoadImageIfNeeded(); |
} |
+void ExtensionInstallPrompt::ReviewPermissions(Delegate* delegate, |
+ const Extension* extension) { |
+ DCHECK(ui_loop_ == MessageLoop::current()); |
+ extension_ = extension; |
+ permissions_ = extension->GetActivePermissions(); |
+ delegate_ = delegate; |
+ prompt_.set_type(POST_INSTALL_PERMISSIONS_PROMPT); |
+ |
+ LoadImageIfNeeded(); |
+} |
+ |
void ExtensionInstallPrompt::OnInstallSuccess(const Extension* extension, |
SkBitmap* icon) { |
extension_ = extension; |
@@ -640,7 +670,8 @@ |
case RE_ENABLE_PROMPT: |
case INLINE_INSTALL_PROMPT: |
case EXTERNAL_INSTALL_PROMPT: |
- case INSTALL_PROMPT: { |
+ case INSTALL_PROMPT: |
+ case POST_INSTALL_PERMISSIONS_PROMPT: { |
prompt_.set_extension(extension_); |
prompt_.set_icon(gfx::Image::CreateFrom1xBitmap(icon_)); |
break; |