| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.
h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.
h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 ExtensionInstallDialogController::ExtensionInstallDialogController( | 40 ExtensionInstallDialogController::ExtensionInstallDialogController( |
| 41 const ExtensionInstallPrompt::ShowParams& show_params, | 41 const ExtensionInstallPrompt::ShowParams& show_params, |
| 42 ExtensionInstallPrompt::Delegate* delegate, | 42 ExtensionInstallPrompt::Delegate* delegate, |
| 43 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) | 43 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) |
| 44 : delegate_(delegate) { | 44 : delegate_(delegate) { |
| 45 view_controller_.reset([[ExtensionInstallViewController alloc] | 45 view_controller_.reset([[ExtensionInstallViewController alloc] |
| 46 initWithNavigator:show_params.navigator | 46 initWithProfile:show_params.profile |
| 47 delegate:this | 47 navigator:show_params.parent_web_contents |
| 48 prompt:prompt]); | 48 delegate:this |
| 49 prompt:prompt]); |
| 49 | 50 |
| 50 base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] | 51 base::scoped_nsobject<NSWindow> window([[ConstrainedWindowCustomWindow alloc] |
| 51 initWithContentRect:[[view_controller_ view] bounds]]); | 52 initWithContentRect:[[view_controller_ view] bounds]]); |
| 52 [[window contentView] addSubview:[view_controller_ view]]; | 53 [[window contentView] addSubview:[view_controller_ view]]; |
| 53 | 54 |
| 54 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 55 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
| 55 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); | 56 [[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]); |
| 56 constrained_window_.reset(new ConstrainedWindowMac( | 57 constrained_window_.reset(new ConstrainedWindowMac( |
| 57 this, show_params.parent_web_contents, sheet)); | 58 this, show_params.parent_web_contents, sheet)); |
| 58 | 59 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 85 if (delegate_) | 86 if (delegate_) |
| 86 delegate_->InstallUIAbort(false); | 87 delegate_->InstallUIAbort(false); |
| 87 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 88 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 88 } | 89 } |
| 89 | 90 |
| 90 // static | 91 // static |
| 91 ExtensionInstallPrompt::ShowDialogCallback | 92 ExtensionInstallPrompt::ShowDialogCallback |
| 92 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { | 93 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { |
| 93 return base::Bind(&ShowExtensionInstallDialogImpl); | 94 return base::Bind(&ShowExtensionInstallDialogImpl); |
| 94 } | 95 } |
| OLD | NEW |