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

Side by Side Diff: ui/views/controls/message_box_view.cc

Issue 2904443006: Views/Harmony Remove references to ui/views/layout/layout_constants.h (Closed)
Patch Set: Add layout_constants.h back to dialog_example.cc as it refers to kUnrelatedControlVerticalSpacing. … 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
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/layout/grid_layout.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/message_box_view.h" 5 #include "ui/views/controls/message_box_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "ui/accessibility/ax_node_data.h" 13 #include "ui/accessibility/ax_node_data.h"
14 #include "ui/base/clipboard/clipboard.h" 14 #include "ui/base/clipboard/clipboard.h"
15 #include "ui/base/clipboard/scoped_clipboard_writer.h" 15 #include "ui/base/clipboard/scoped_clipboard_writer.h"
16 #include "ui/views/controls/button/checkbox.h" 16 #include "ui/views/controls/button/checkbox.h"
17 #include "ui/views/controls/label.h" 17 #include "ui/views/controls/label.h"
18 #include "ui/views/controls/link.h" 18 #include "ui/views/controls/link.h"
19 #include "ui/views/controls/scroll_view.h" 19 #include "ui/views/controls/scroll_view.h"
20 #include "ui/views/controls/textfield/textfield.h" 20 #include "ui/views/controls/textfield/textfield.h"
21 #include "ui/views/layout/box_layout.h" 21 #include "ui/views/layout/box_layout.h"
22 #include "ui/views/layout/grid_layout.h" 22 #include "ui/views/layout/grid_layout.h"
23 #include "ui/views/layout/layout_constants.h" 23 #include "ui/views/layout/layout_provider.h"
24 #include "ui/views/widget/widget.h" 24 #include "ui/views/widget/widget.h"
25 #include "ui/views/window/client_view.h" 25 #include "ui/views/window/client_view.h"
26 #include "ui/views/window/dialog_delegate.h" 26 #include "ui/views/window/dialog_delegate.h"
27 27
28 namespace { 28 namespace {
29 29
30 const int kDefaultMessageWidth = 400; 30 const int kDefaultMessageWidth = 400;
31 31
32 // Paragraph separators are defined in 32 // Paragraph separators are defined in
33 // http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBidiClass.txt 33 // http://www.unicode.org/Public/6.0.0/ucd/extracted/DerivedBidiClass.txt
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 /////////////////////////////////////////////////////////////////////////////// 68 ///////////////////////////////////////////////////////////////////////////////
69 // MessageBoxView, public: 69 // MessageBoxView, public:
70 70
71 // static 71 // static
72 const char MessageBoxView::kViewClassName[] = "MessageBoxView"; 72 const char MessageBoxView::kViewClassName[] = "MessageBoxView";
73 73
74 MessageBoxView::InitParams::InitParams(const base::string16& message) 74 MessageBoxView::InitParams::InitParams(const base::string16& message)
75 : options(NO_OPTIONS), 75 : options(NO_OPTIONS),
76 message(message), 76 message(message),
77 message_width(kDefaultMessageWidth), 77 message_width(kDefaultMessageWidth),
78 inter_row_vertical_spacing(kRelatedControlVerticalSpacing) {} 78 inter_row_vertical_spacing(LayoutProvider::Get()->GetDistanceMetric(
79 DISTANCE_RELATED_CONTROL_VERTICAL)) {}
79 80
80 MessageBoxView::InitParams::~InitParams() { 81 MessageBoxView::InitParams::~InitParams() {
81 } 82 }
82 83
83 MessageBoxView::MessageBoxView(const InitParams& params) 84 MessageBoxView::MessageBoxView(const InitParams& params)
84 : prompt_field_(NULL), 85 : prompt_field_(NULL),
85 checkbox_(NULL), 86 checkbox_(NULL),
86 link_(NULL), 87 link_(NULL),
87 message_width_(params.message_width) { 88 message_width_(params.message_width) {
88 Init(params); 89 Init(params);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 254 }
254 255
255 if (link_) { 256 if (link_) {
256 layout->AddPaddingRow(0, inter_row_vertical_spacing_); 257 layout->AddPaddingRow(0, inter_row_vertical_spacing_);
257 layout->StartRow(0, extra_column_view_set_id); 258 layout->StartRow(0, extra_column_view_set_id);
258 layout->AddView(link_); 259 layout->AddView(link_);
259 } 260 }
260 } 261 }
261 262
262 } // namespace views 263 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/layout/grid_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698