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

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

Issue 2833603003: Log the creation of more dialog box types. (Closed)
Patch Set: Fix simple merge conflict. Created 3 years, 7 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
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 <memory> 5 #include <memory>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/extensions/extension_uninstall_dialog.h" 11 #include "chrome/browser/extensions/extension_uninstall_dialog.h"
12 #include "chrome/browser/ui/app_list/app_list_service.h" 12 #include "chrome/browser/ui/app_list/app_list_service.h"
13 #include "chrome/browser/ui/browser_dialogs.h"
13 #include "chrome/browser/ui/native_window_tracker.h" 14 #include "chrome/browser/ui/native_window_tracker.h"
14 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" 15 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
15 #include "chrome/grit/generated_resources.h" 16 #include "chrome/grit/generated_resources.h"
16 #include "components/constrained_window/constrained_window_views.h" 17 #include "components/constrained_window/constrained_window_views.h"
17 #include "components/strings/grit/components_strings.h" 18 #include "components/strings/grit/components_strings.h"
18 #include "extensions/common/extension.h" 19 #include "extensions/common/extension.h"
19 #include "ui/base/l10n/l10n_util.h" 20 #include "ui/base/l10n/l10n_util.h"
20 #include "ui/compositor/compositor.h" 21 #include "ui/compositor/compositor.h"
21 #include "ui/compositor/layer.h" 22 #include "ui/compositor/layer.h"
22 #include "ui/views/controls/button/checkbox.h" 23 #include "ui/views/controls/button/checkbox.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 icon_->SetImageSize(gfx::Size(kIconSize, kIconSize)); 182 icon_->SetImageSize(gfx::Size(kIconSize, kIconSize));
182 icon_->SetImage(*image); 183 icon_->SetImage(*image);
183 AddChildView(icon_); 184 AddChildView(icon_);
184 185
185 heading_ = new views::Label(base::UTF8ToUTF16(dialog_->GetHeadingText())); 186 heading_ = new views::Label(base::UTF8ToUTF16(dialog_->GetHeadingText()));
186 heading_->SetMultiLine(true); 187 heading_->SetMultiLine(true);
187 heading_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 188 heading_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
188 heading_->SetAllowCharacterBreak(true); 189 heading_->SetAllowCharacterBreak(true);
189 heading_->SizeToFit(kRightColumnWidth); 190 heading_->SizeToFit(kRightColumnWidth);
190 AddChildView(heading_); 191 AddChildView(heading_);
192
193 chrome::RecordDialogCreation(chrome::DialogIdentifier::EXTENSION_UNINSTALL);
191 } 194 }
192 195
193 ExtensionUninstallDialogDelegateView::~ExtensionUninstallDialogDelegateView() { 196 ExtensionUninstallDialogDelegateView::~ExtensionUninstallDialogDelegateView() {
194 // If we're here, 2 things could have happened. Either the user closed the 197 // If we're here, 2 things could have happened. Either the user closed the
195 // dialog nicely and one of the installed/canceled methods has been called 198 // dialog nicely and one of the installed/canceled methods has been called
196 // (in which case dialog_ will be null), *or* neither of them have been 199 // (in which case dialog_ will be null), *or* neither of them have been
197 // called and we are being forced closed by our parent widget. In this case, 200 // called and we are being forced closed by our parent widget. In this case,
198 // we need to make sure to notify dialog_ not to call us again, since we're 201 // we need to make sure to notify dialog_ not to call us again, since we're
199 // about to be freed by the Widget framework. 202 // about to be freed by the Widget framework.
200 if (dialog_) 203 if (dialog_)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 246
244 } // namespace 247 } // namespace
245 248
246 // static 249 // static
247 extensions::ExtensionUninstallDialog* 250 extensions::ExtensionUninstallDialog*
248 extensions::ExtensionUninstallDialog::Create(Profile* profile, 251 extensions::ExtensionUninstallDialog::Create(Profile* profile,
249 gfx::NativeWindow parent, 252 gfx::NativeWindow parent,
250 Delegate* delegate) { 253 Delegate* delegate) {
251 return new ExtensionUninstallDialogViews(profile, parent, delegate); 254 return new ExtensionUninstallDialogViews(profile, parent, delegate);
252 } 255 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698