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

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm

Issue 11087071: Making ShowExtensionInstallDialog a callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/ui/cocoa/extensions/extension_install_dialog_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
index 4d552cfa04836c55b6b3d182e9d4c06a642d328e..aa1304f4f6e62ff1093c12a7d26f7987b707d592 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
@@ -534,18 +534,31 @@ void DrawBulletInFrame(NSRect frame) {
@end // ExtensionInstallDialogController
-void ShowExtensionInstallDialogImpl(
- gfx::NativeWindow parent,
- content::PageNavigator* navigator,
- ExtensionInstallPrompt::Delegate* delegate,
- const ExtensionInstallPrompt::Prompt& prompt) {
- ExtensionInstallDialogController* controller =
- [[ExtensionInstallDialogController alloc]
- initWithParentWindow:parent
- navigator:navigator
- delegate:delegate
- prompt:prompt];
-
- // TODO(mihaip): Switch this to be tab-modal (http://crbug.com/95455)
- [controller runAsModalSheet];
+class ExtensionInstallDialogMac : public ExtensionInstallDialog {
+ public:
+ virtual void ShowExtensionInstallDialogImpl(
+ gfx::NativeWindow parent,
+ content::PageNavigator* navigator,
+ ExtensionInstallPrompt::Delegate* delegate,
+ const ExtensionInstallPrompt::Prompt& prompt) OVERRIDE {
+ ExtensionInstallDialogController* controller =
+ [[ExtensionInstallDialogController alloc]
+ initWithParentWindow:parent
+ navigator:navigator
+ delegate:delegate
+ prompt:prompt];
+
+ // TODO(mihaip): Switch this to be tab-modal (http://crbug.com/95455)
+ [controller runAsModalSheet];
+ }
+
+ private:
+ ~ExtensionInstallDialogMac() {
+ }
+};
+
+// static
+scoped_refptr<ExtensionInstallDialog>
+ExtensionInstallDialog::CreateDefaultImpl() {
+ return new ExtensionInstallDialogMac;
}

Powered by Google App Engine
This is Rietveld 408576698