OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 9 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
13 #include "chrome/browser/ui/dialog_style.h" | |
13 #include "chrome/browser/ui/views/window.h" | 14 #include "chrome/browser/ui/views/window.h" |
14 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
15 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
17 #include "ui/gfx/compositor/compositor.h" | 18 #include "ui/gfx/compositor/compositor.h" |
18 #include "ui/gfx/compositor/layer.h" | 19 #include "ui/gfx/compositor/layer.h" |
19 #include "ui/views/layout/layout_constants.h" | 20 #include "ui/views/layout/layout_constants.h" |
20 #include "ui/views/window/dialog_delegate.h" | 21 #include "ui/views/window/dialog_delegate.h" |
21 #include "views/controls/image_view.h" | 22 #include "views/controls/image_view.h" |
22 #include "views/controls/label.h" | 23 #include "views/controls/label.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 return; | 111 return; |
111 } | 112 } |
112 | 113 |
113 BrowserWindow* window = browser->window(); | 114 BrowserWindow* window = browser->window(); |
114 if (!window) { | 115 if (!window) { |
115 delegate_->ExtensionUninstallCanceled(); | 116 delegate_->ExtensionUninstallCanceled(); |
116 return; | 117 return; |
117 } | 118 } |
118 | 119 |
119 view_ = new ExtensionUninstallDialogDelegateView(this, extension_, &icon_); | 120 view_ = new ExtensionUninstallDialogDelegateView(this, extension_, &icon_); |
120 browser::CreateViewsWindow(window->GetNativeHandle(), view_)->Show(); | 121 browser::CreateViewsWindow(window->GetNativeHandle(), view_, |
122 STYLE_GENERIC)->Show(); | |
flackr
2011/11/21 20:43:31
One argument per line.
bshe
2011/11/22 16:26:24
Done.
| |
121 } | 123 } |
122 | 124 |
123 void ExtensionUninstallDialogViews::ExtensionUninstallAccepted() { | 125 void ExtensionUninstallDialogViews::ExtensionUninstallAccepted() { |
124 // The widget gets destroyed when the dialog is accepted. | 126 // The widget gets destroyed when the dialog is accepted. |
125 view_ = NULL; | 127 view_ = NULL; |
126 delegate_->ExtensionUninstallAccepted(); | 128 delegate_->ExtensionUninstallAccepted(); |
127 } | 129 } |
128 | 130 |
129 void ExtensionUninstallDialogViews::ExtensionUninstallCanceled() { | 131 void ExtensionUninstallDialogViews::ExtensionUninstallCanceled() { |
130 // The widget gets destroyed when the dialog is canceled. | 132 // The widget gets destroyed when the dialog is canceled. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 } | 226 } |
225 } | 227 } |
226 | 228 |
227 } // namespace | 229 } // namespace |
228 | 230 |
229 // static | 231 // static |
230 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( | 232 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( |
231 Profile* profile, Delegate* delegate) { | 233 Profile* profile, Delegate* delegate) { |
232 return new ExtensionUninstallDialogViews(profile, delegate); | 234 return new ExtensionUninstallDialogViews(profile, delegate); |
233 } | 235 } |
OLD | NEW |