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/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 constrained_window_.reset(new ConstrainedWindowMac( | 47 constrained_window_.reset(new ConstrainedWindowMac( |
48 this, web_contents, sheet)); | 48 this, web_contents, sheet)); |
49 } | 49 } |
50 | 50 |
51 ExtensionInstallDialogController::~ExtensionInstallDialogController() { | 51 ExtensionInstallDialogController::~ExtensionInstallDialogController() { |
52 } | 52 } |
53 | 53 |
54 void ExtensionInstallDialogController::InstallUIProceed() { | 54 void ExtensionInstallDialogController::InstallUIProceed() { |
55 delegate_->InstallUIProceed(); | 55 delegate_->InstallUIProceed(); |
56 delegate_ = NULL; | 56 delegate_ = NULL; |
57 constrained_window_->CloseConstrainedWindow(); | 57 constrained_window_->CloseWebContentsModalDialog(); |
58 } | 58 } |
59 | 59 |
60 void ExtensionInstallDialogController::InstallUIAbort(bool user_initiated) { | 60 void ExtensionInstallDialogController::InstallUIAbort(bool user_initiated) { |
61 delegate_->InstallUIAbort(user_initiated); | 61 delegate_->InstallUIAbort(user_initiated); |
62 delegate_ = NULL; | 62 delegate_ = NULL; |
63 constrained_window_->CloseConstrainedWindow(); | 63 constrained_window_->CloseWebContentsModalDialog(); |
64 } | 64 } |
65 | 65 |
66 void ExtensionInstallDialogController::OnConstrainedWindowClosed( | 66 void ExtensionInstallDialogController::OnConstrainedWindowClosed( |
67 ConstrainedWindowMac* window) { | 67 ConstrainedWindowMac* window) { |
68 if (delegate_) | 68 if (delegate_) |
69 delegate_->InstallUIAbort(false); | 69 delegate_->InstallUIAbort(false); |
70 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 70 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
71 } | 71 } |
72 | 72 |
73 // static | 73 // static |
74 ExtensionInstallPrompt::ShowDialogCallback | 74 ExtensionInstallPrompt::ShowDialogCallback |
75 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { | 75 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { |
76 return base::Bind(&ShowExtensionInstallDialogImpl); | 76 return base::Bind(&ShowExtensionInstallDialogImpl); |
77 } | 77 } |
OLD | NEW |