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

Side by Side Diff: chrome/browser/chromeos/ui/echo_dialog_view.cc

Issue 2881683002: Log the creation of several more dialog box types. (Closed)
Patch Set: Fix alphabetization errors. 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/ui/echo_dialog_view.h" 5 #include "chrome/browser/chromeos/ui/echo_dialog_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "chrome/browser/chromeos/ui/echo_dialog_listener.h" 9 #include "chrome/browser/chromeos/ui/echo_dialog_listener.h"
10 #include "chrome/browser/ui/browser_dialogs.h"
10 #include "chrome/grit/generated_resources.h" 11 #include "chrome/grit/generated_resources.h"
11 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
12 #include "ui/gfx/font.h" 13 #include "ui/gfx/font.h"
13 #include "ui/views/border.h" 14 #include "ui/views/border.h"
14 #include "ui/views/controls/styled_label.h" 15 #include "ui/views/controls/styled_label.h"
15 #include "ui/views/widget/widget.h" 16 #include "ui/views/widget/widget.h"
16 #include "ui/views/window/dialog_client_view.h" 17 #include "ui/views/window/dialog_client_view.h"
17 18
18 namespace { 19 namespace {
19 20
20 const int kDialogLabelTopInset = 20; 21 const int kDialogLabelTopInset = 20;
21 const int kDialogLabelLeftInset = 20; 22 const int kDialogLabelLeftInset = 20;
22 const int kDialogLabelBottomInset = 20; 23 const int kDialogLabelBottomInset = 20;
23 const int kDialogLabelRightInset = 100; 24 const int kDialogLabelRightInset = 100;
24 25
25 const int kDialogLabelPreferredWidth = 26 const int kDialogLabelPreferredWidth =
26 350 + kDialogLabelLeftInset + kDialogLabelRightInset; 27 350 + kDialogLabelLeftInset + kDialogLabelRightInset;
27 28
28 } // namespace 29 } // namespace
29 30
30 namespace chromeos { 31 namespace chromeos {
31 32
32 EchoDialogView::EchoDialogView(EchoDialogListener* listener) 33 EchoDialogView::EchoDialogView(EchoDialogListener* listener)
33 : label_(NULL), 34 : label_(NULL),
34 listener_(listener), 35 listener_(listener),
35 ok_button_label_id_(0), 36 ok_button_label_id_(0),
36 cancel_button_label_id_(0) { 37 cancel_button_label_id_(0) {
38 chrome::RecordDialogCreation(chrome::DialogIdentifier::ECHO);
37 } 39 }
38 40
39 EchoDialogView::~EchoDialogView() {} 41 EchoDialogView::~EchoDialogView() {}
40 42
41 void EchoDialogView::InitForEnabledEcho(const base::string16& service_name, 43 void EchoDialogView::InitForEnabledEcho(const base::string16& service_name,
42 const base::string16& origin) { 44 const base::string16& origin) {
43 ok_button_label_id_ = IDS_OFFERS_CONSENT_INFOBAR_ENABLE_BUTTON; 45 ok_button_label_id_ = IDS_OFFERS_CONSENT_INFOBAR_ENABLE_BUTTON;
44 cancel_button_label_id_ = IDS_OFFERS_CONSENT_INFOBAR_DISABLE_BUTTON; 46 cancel_button_label_id_ = IDS_OFFERS_CONSENT_INFOBAR_DISABLE_BUTTON;
45 47
46 base::string16 link = 48 base::string16 link =
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 kDialogLabelTopInset, kDialogLabelLeftInset, kDialogLabelBottomInset, 177 kDialogLabelTopInset, kDialogLabelLeftInset, kDialogLabelBottomInset,
176 kDialogLabelRightInset)); 178 kDialogLabelRightInset));
177 179
178 label_->SetBounds(label_->x(), 180 label_->SetBounds(label_->x(),
179 label_->y(), 181 label_->y(),
180 kDialogLabelPreferredWidth, 182 kDialogLabelPreferredWidth,
181 label_->GetHeightForWidth(kDialogLabelPreferredWidth)); 183 label_->GetHeightForWidth(kDialogLabelPreferredWidth));
182 } 184 }
183 185
184 } // namespace chromeos 186 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698