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

Side by Side Diff: chrome/browser/ui/views/confirm_bubble_views.cc

Issue 2802703004: Log creation for many dialog box types. (Closed)
Patch Set: qualify RecordDialogCreation with chrome:: Created 3 years, 8 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 "chrome/browser/ui/views/confirm_bubble_views.h" 5 #include "chrome/browser/ui/views/confirm_bubble_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/ui/browser_dialogs.h"
9 #include "chrome/browser/ui/confirm_bubble.h" 10 #include "chrome/browser/ui/confirm_bubble.h"
10 #include "chrome/browser/ui/confirm_bubble_model.h" 11 #include "chrome/browser/ui/confirm_bubble_model.h"
11 #include "components/constrained_window/constrained_window_views.h" 12 #include "components/constrained_window/constrained_window_views.h"
12 #include "ui/base/ui_features.h" 13 #include "ui/base/ui_features.h"
13 #include "ui/views/controls/label.h" 14 #include "ui/views/controls/label.h"
14 #include "ui/views/controls/link.h" 15 #include "ui/views/controls/link.h"
15 #include "ui/views/layout/grid_layout.h" 16 #include "ui/views/layout/grid_layout.h"
16 #include "ui/views/layout/layout_constants.h" 17 #include "ui/views/layout/layout_constants.h"
17 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
18 19
(...skipping 14 matching lines...) Expand all
33 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 34 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
34 label->SetMultiLine(true); 35 label->SetMultiLine(true);
35 label->SizeToFit(kMaxMessageWidth); 36 label->SizeToFit(kMaxMessageWidth);
36 layout->StartRow(0, 0); 37 layout->StartRow(0, 0);
37 layout->AddView(label); 38 layout->AddView(label);
38 39
39 // Initialize the link. 40 // Initialize the link.
40 link_ = new views::Link(model_->GetLinkText()); 41 link_ = new views::Link(model_->GetLinkText());
41 link_->set_listener(this); 42 link_->set_listener(this);
42 link_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 43 link_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
44
45 chrome::RecordDialogCreation(
46 chrome::DialogIdentifier::ASK_GOOGLE_FOR_SUGGESTIONS);
msw 2017/04/07 10:31:09 Hmm, I know this is (probably?) only used for the
43 } 47 }
44 48
45 ConfirmBubbleViews::~ConfirmBubbleViews() { 49 ConfirmBubbleViews::~ConfirmBubbleViews() {
46 } 50 }
47 51
48 base::string16 ConfirmBubbleViews::GetDialogButtonLabel( 52 base::string16 ConfirmBubbleViews::GetDialogButtonLabel(
49 ui::DialogButton button) const { 53 ui::DialogButton button) const {
50 switch (button) { 54 switch (button) {
51 case ui::DIALOG_BUTTON_OK: 55 case ui::DIALOG_BUTTON_OK:
52 return model_->GetButtonLabel(ConfirmBubbleModel::BUTTON_OK); 56 return model_->GetButtonLabel(ConfirmBubbleModel::BUTTON_OK);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 gfx::NativeView anchor_view, 110 gfx::NativeView anchor_view,
107 const gfx::Point& origin, 111 const gfx::Point& origin,
108 std::unique_ptr<ConfirmBubbleModel> model) { 112 std::unique_ptr<ConfirmBubbleModel> model) {
109 constrained_window::CreateBrowserModalDialogViews( 113 constrained_window::CreateBrowserModalDialogViews(
110 new ConfirmBubbleViews(std::move(model)), window) 114 new ConfirmBubbleViews(std::move(model)), window)
111 ->Show(); 115 ->Show();
112 } 116 }
113 #endif // !OS_MACOSX || MAC_VIEWS_BROWSER 117 #endif // !OS_MACOSX || MAC_VIEWS_BROWSER
114 118
115 } // namespace chrome 119 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698