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

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

Issue 660643002: [Refactor] Move creating a browser if necessary to ExtensionInstallDialogView (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/ui/cocoa/extensions/windowed_install_dialog_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm
index c4578693582212152b07e79db73e58701013e22c..8a4f17aa5e035e37c2c2a962c880b3d198e3802d 100644
--- a/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm
@@ -7,7 +7,9 @@
#import "base/mac/sdk_forward_declarations.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/sys_string_conversions.h"
+#include "chrome/browser/profiles/profile.h"
#import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h"
+#include "content/public/browser/web_contents.h"
#include "ui/base/cocoa/window_size_constants.h"
@interface WindowedInstallController
@@ -19,9 +21,10 @@
@property(readonly, nonatomic) ExtensionInstallViewController* viewController;
-- (id)initWithNavigator:(content::PageNavigator*)navigator
- delegate:(WindowedInstallDialogController*)delegate
- prompt:(scoped_refptr<ExtensionInstallPrompt::Prompt>)prompt;
+- (id)initWithProfile:(Profile*)profile
+ navigator:(content::PageNavigator*)navigator
+ delegate:(WindowedInstallDialogController*)delegate
+ prompt:(scoped_refptr<ExtensionInstallPrompt::Prompt>)prompt;
@end
@@ -31,7 +34,8 @@ WindowedInstallDialogController::WindowedInstallDialogController(
scoped_refptr<ExtensionInstallPrompt::Prompt> prompt)
: delegate_(delegate) {
install_controller_.reset([[WindowedInstallController alloc]
- initWithNavigator:show_params.navigator
+ initWithProfile:show_params.profile
+ navigator:show_params.parent_web_contents
delegate:this
sky 2014/10/21 18:04:24 nit: spacing is off here.
prompt:prompt]);
[[install_controller_ window] makeKeyAndOrderFront:nil];
@@ -70,9 +74,10 @@ void WindowedInstallDialogController::InstallUIAbort(bool user_initiated) {
@implementation WindowedInstallController
-- (id)initWithNavigator:(content::PageNavigator*)navigator
- delegate:(WindowedInstallDialogController*)delegate
- prompt:(scoped_refptr<ExtensionInstallPrompt::Prompt>)prompt {
+- (id)initWithProfile:(Profile*)profile
+ navigator:(content::PageNavigator*)navigator
+ delegate:(WindowedInstallDialogController*)delegate
+ prompt:(scoped_refptr<ExtensionInstallPrompt::Prompt>)prompt {
base::scoped_nsobject<NSWindow> controlledPanel(
[[NSPanel alloc] initWithContentRect:ui::kWindowSizeDeterminedLater
styleMask:NSTitledWindowMask
@@ -81,9 +86,10 @@ void WindowedInstallDialogController::InstallUIAbort(bool user_initiated) {
if ((self = [super initWithWindow:controlledPanel])) {
dialogController_ = delegate;
installViewController_.reset([[ExtensionInstallViewController alloc]
- initWithNavigator:navigator
- delegate:delegate
- prompt:prompt]);
+ initWithProfile:profile
+ navigator:navigator
+ delegate:delegate
+ prompt:prompt]);
NSWindow* window = [self window];
// Ensure the window does not display behind the app launcher window, and is

Powered by Google App Engine
This is Rietveld 408576698