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

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

Issue 634313004: Display dialog when app install succeeds / fails on Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 0af21940338ff4a6ee58dd25248b0c960ba20dba..24bd6a09909c79f7faa4c1f4c25a00e355fb998b 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -14,10 +14,10 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/bundle_installer.h"
-#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/permissions_updater.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/extensions/extension_install_ui_factory.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/chromium_strings.h"
@@ -26,6 +26,7 @@
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/image_loader.h"
+#include "extensions/browser/install/extension_install_ui.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
@@ -658,10 +659,12 @@ scoped_refptr<Extension>
}
ExtensionInstallPrompt::ExtensionInstallPrompt(content::WebContents* contents)
- : ui_loop_(base::MessageLoop::current()),
+ : profile_(ProfileForWebContents(contents)),
+ ui_loop_(base::MessageLoop::current()),
extension_(NULL),
bundle_(NULL),
- install_ui_(ExtensionInstallUI::Create(ProfileForWebContents(contents))),
+ install_ui_(extensions::CreateExtensionInstallUI(
+ ProfileForWebContents(contents))),
show_params_(contents),
delegate_(NULL) {
}
@@ -670,10 +673,11 @@ ExtensionInstallPrompt::ExtensionInstallPrompt(
Profile* profile,
gfx::NativeWindow native_window,
content::PageNavigator* navigator)
- : ui_loop_(base::MessageLoop::current()),
+ : profile_(profile),
+ ui_loop_(base::MessageLoop::current()),
extension_(NULL),
bundle_(NULL),
- install_ui_(ExtensionInstallUI::Create(profile)),
+ install_ui_(extensions::CreateExtensionInstallUI(profile)),
show_params_(native_window, navigator),
delegate_(NULL) {
}
@@ -753,11 +757,11 @@ void ExtensionInstallPrompt::ConfirmReEnable(Delegate* delegate,
extension_ = extension;
delegate_ = delegate;
bool is_remote_install =
- install_ui_->profile() &&
- extensions::ExtensionPrefs::Get(install_ui_->profile())->HasDisableReason(
+ profile_ &&
+ extensions::ExtensionPrefs::Get(profile_)->HasDisableReason(
extension->id(), extensions::Extension::DISABLE_REMOTE_INSTALL);
bool is_ephemeral =
- extensions::util::IsEphemeralApp(extension->id(), install_ui_->profile());
+ extensions::util::IsEphemeralApp(extension->id(), profile_);
PromptType type = UNSET_PROMPT_TYPE;
if (is_ephemeral)
@@ -846,8 +850,8 @@ void ExtensionInstallPrompt::OnImageLoaded(const gfx::Image& image) {
void ExtensionInstallPrompt::LoadImageIfNeeded() {
// Bundle install prompts do not have an icon.
- // Also |install_ui_.profile()| can be NULL in unit tests.
- if (!icon_.empty() || !install_ui_->profile()) {
+ // Also |profile_| can be NULL in unit tests.
+ if (!icon_.empty() || !profile_) {
ShowConfirmation();
return;
}
@@ -858,8 +862,7 @@ void ExtensionInstallPrompt::LoadImageIfNeeded() {
ExtensionIconSet::MATCH_BIGGER);
// Load the image asynchronously. The response will be sent to OnImageLoaded.
- extensions::ImageLoader* loader =
- extensions::ImageLoader::Get(install_ui_->profile());
+ extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile_);
std::vector<extensions::ImageLoader::ImageRepresentation> images_list;
images_list.push_back(extensions::ImageLoader::ImageRepresentation(
@@ -886,8 +889,7 @@ void ExtensionInstallPrompt::ShowConfirmation() {
// Initialize permissions if they have not already been set so that
// withheld permissions are displayed properly in the install prompt.
extensions::PermissionsUpdater(
- install_ui_->profile(),
- extensions::PermissionsUpdater::INIT_FLAG_TRANSIENT)
+ profile_, extensions::PermissionsUpdater::INIT_FLAG_TRANSIENT)
.InitializePermissions(extension_);
permissions_to_display =
extension_->permissions_data()->active_permissions();
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.h ('k') | chrome/browser/extensions/extension_install_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698