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 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 5 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 140 } |
141 | 141 |
142 void ExtensionUninstallDialogViews::Show() { | 142 void ExtensionUninstallDialogViews::Show() { |
143 gfx::NativeWindow parent = GetParent(browser_); | 143 gfx::NativeWindow parent = GetParent(browser_); |
144 if (browser_ && !parent) { | 144 if (browser_ && !parent) { |
145 delegate_->ExtensionUninstallCanceled(); | 145 delegate_->ExtensionUninstallCanceled(); |
146 return; | 146 return; |
147 } | 147 } |
148 | 148 |
149 view_ = new ExtensionUninstallDialogDelegateView(this, extension_, &icon_); | 149 view_ = new ExtensionUninstallDialogDelegateView(this, extension_, &icon_); |
150 views::Widget::CreateWindowWithParent(view_, parent)->Show(); | 150 views::DialogDelegate::CreateDialogWidget(view_, NULL, parent)->Show(); |
151 } | 151 } |
152 | 152 |
153 void ExtensionUninstallDialogViews::ExtensionUninstallAccepted() { | 153 void ExtensionUninstallDialogViews::ExtensionUninstallAccepted() { |
154 // The widget gets destroyed when the dialog is accepted. | 154 // The widget gets destroyed when the dialog is accepted. |
155 view_ = NULL; | 155 view_ = NULL; |
156 delegate_->ExtensionUninstallAccepted(); | 156 delegate_->ExtensionUninstallAccepted(); |
157 } | 157 } |
158 | 158 |
159 void ExtensionUninstallDialogViews::ExtensionUninstallCanceled() { | 159 void ExtensionUninstallDialogViews::ExtensionUninstallCanceled() { |
160 // The widget gets destroyed when the dialog is canceled. | 160 // The widget gets destroyed when the dialog is canceled. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 249 |
250 } // namespace | 250 } // namespace |
251 | 251 |
252 // static | 252 // static |
253 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( | 253 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( |
254 Profile* profile, | 254 Profile* profile, |
255 Browser* browser, | 255 Browser* browser, |
256 Delegate* delegate) { | 256 Delegate* delegate) { |
257 return new ExtensionUninstallDialogViews(profile, browser, delegate); | 257 return new ExtensionUninstallDialogViews(profile, browser, delegate); |
258 } | 258 } |
OLD | NEW |