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_; |