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

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

Issue 683993002: Revert of Fix crash when user closes window prior to the "Confirm Install" prompt showing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/install_prompt_navigator
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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_install_prompt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_install_prompt.h
diff --git a/chrome/browser/extensions/extension_install_prompt.h b/chrome/browser/extensions/extension_install_prompt.h
index f4a87e5e8b70b40853edddc693f7a43522b2d281..dca96db147899d21778338bf474598c78a85bccd 100644
--- a/chrome/browser/extensions/extension_install_prompt.h
+++ b/chrome/browser/extensions/extension_install_prompt.h
@@ -22,7 +22,6 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h"
-class ExtensionInstallPromptShowParams;
class Profile;
namespace base {
@@ -280,7 +279,23 @@
virtual ~Delegate() {}
};
- typedef base::Callback<void(ExtensionInstallPromptShowParams*,
+ // Parameters to show a prompt dialog. Two sets of the
+ // parameters are supported: either use a parent WebContents or use a
+ // parent NativeWindow + a Profile.
+ struct ShowParams {
+ explicit ShowParams(content::WebContents* contents);
+ ShowParams(Profile* profile, gfx::NativeWindow window);
+
+ Profile* profile;
+
+ // Parent web contents of the install UI dialog. This can be NULL.
+ content::WebContents* parent_web_contents;
+
+ // NativeWindow parent.
+ gfx::NativeWindow parent_window;
+ };
+
+ typedef base::Callback<void(const ExtensionInstallPrompt::ShowParams&,
ExtensionInstallPrompt::Delegate*,
scoped_refptr<ExtensionInstallPrompt::Prompt>)>
ShowDialogCallback;
@@ -313,6 +328,10 @@
return install_ui_.get();
}
+ content::WebContents* parent_web_contents() const {
+ return show_params_.parent_web_contents;
+ }
+
// This is called by the bundle installer to verify whether the bundle
// should be installed.
//
@@ -443,7 +462,7 @@
scoped_ptr<extensions::ExtensionInstallUI> install_ui_;
// Parameters to show the confirmation UI.
- scoped_ptr<ExtensionInstallPromptShowParams> show_params_;
+ ShowParams show_params_;
// The delegate we will call Proceed/Abort on after confirmation UI.
Delegate* delegate_;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_install_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698