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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc

Issue 16374006: Place browser-modal dialogs like web-contents-modal dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert changes to c/b/chromeos files for now. Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "chrome/browser/ui/app_list/app_list_service.h" 11 #include "chrome/browser/ui/app_list/app_list_service.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_window.h" 13 #include "chrome/browser/ui/browser_window.h"
14 #include "chrome/browser/ui/views/constrained_window_views.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/compositor/compositor.h" 18 #include "ui/compositor/compositor.h"
18 #include "ui/compositor/layer.h" 19 #include "ui/compositor/layer.h"
19 #include "ui/views/controls/image_view.h" 20 #include "ui/views/controls/image_view.h"
20 #include "ui/views/controls/label.h" 21 #include "ui/views/controls/label.h"
21 #include "ui/views/layout/layout_constants.h" 22 #include "ui/views/layout/layout_constants.h"
22 #include "ui/views/view.h" 23 #include "ui/views/view.h"
23 #include "ui/views/widget/widget.h" 24 #include "ui/views/widget/widget.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 138 }
138 139
139 void ExtensionUninstallDialogViews::Show() { 140 void ExtensionUninstallDialogViews::Show() {
140 gfx::NativeWindow parent = GetParent(browser_); 141 gfx::NativeWindow parent = GetParent(browser_);
141 if (browser_ && !parent) { 142 if (browser_ && !parent) {
142 delegate_->ExtensionUninstallCanceled(); 143 delegate_->ExtensionUninstallCanceled();
143 return; 144 return;
144 } 145 }
145 146
146 view_ = new ExtensionUninstallDialogDelegateView(this, extension_, &icon_); 147 view_ = new ExtensionUninstallDialogDelegateView(this, extension_, &icon_);
147 views::DialogDelegate::CreateDialogWidget(view_, NULL, parent)->Show(); 148 CreateBrowserModalDialogViews(view_, parent)->Show();
148 } 149 }
149 150
150 void ExtensionUninstallDialogViews::ExtensionUninstallAccepted() { 151 void ExtensionUninstallDialogViews::ExtensionUninstallAccepted() {
151 // The widget gets destroyed when the dialog is accepted. 152 // The widget gets destroyed when the dialog is accepted.
152 view_ = NULL; 153 view_ = NULL;
153 delegate_->ExtensionUninstallAccepted(); 154 delegate_->ExtensionUninstallAccepted();
154 } 155 }
155 156
156 void ExtensionUninstallDialogViews::ExtensionUninstallCanceled() { 157 void ExtensionUninstallDialogViews::ExtensionUninstallCanceled() {
157 // The widget gets destroyed when the dialog is canceled. 158 // The widget gets destroyed when the dialog is canceled.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 247
247 } // namespace 248 } // namespace
248 249
249 // static 250 // static
250 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( 251 ExtensionUninstallDialog* ExtensionUninstallDialog::Create(
251 Profile* profile, 252 Profile* profile,
252 Browser* browser, 253 Browser* browser,
253 Delegate* delegate) { 254 Delegate* delegate) {
254 return new ExtensionUninstallDialogViews(profile, browser, delegate); 255 return new ExtensionUninstallDialogViews(profile, browser, delegate);
255 } 256 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698