OLD | NEW |
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/power/idle_action_warning_dialog_view.h" | 5 #include "chrome/browser/chromeos/power/idle_action_warning_dialog_view.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
11 #include "ui/base/ui_base_types.h" | 11 #include "ui/base/ui_base_types.h" |
12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
13 #include "ui/gfx/text_constants.h" | 13 #include "ui/gfx/text_constants.h" |
14 #include "ui/views/border.h" | 14 #include "ui/views/border.h" |
15 #include "ui/views/controls/label.h" | 15 #include "ui/views/controls/label.h" |
16 #include "ui/views/layout/fill_layout.h" | 16 #include "ui/views/layout/fill_layout.h" |
17 #include "ui/views/layout/layout_constants.h" | 17 #include "ui/views/layout/layout_constants.h" |
18 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
19 #include "ui/views/window/dialog_client_view.h" | 19 #include "ui/views/window/dialog_client_view.h" |
20 | 20 |
21 namespace chromeos { | 21 namespace chromeos { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 const int kIdleActionWarningContentWidth = 300; | 25 const int kIdleActionWarningContentWidth = 300; |
26 | 26 |
27 class FixedWidthLabel : public views::Label { | 27 class FixedWidthLabel : public views::Label { |
28 public: | 28 public: |
29 FixedWidthLabel(const string16& text, int width); | 29 FixedWidthLabel(const base::string16& text, int width); |
30 virtual ~FixedWidthLabel(); | 30 virtual ~FixedWidthLabel(); |
31 | 31 |
32 virtual gfx::Size GetPreferredSize() OVERRIDE; | 32 virtual gfx::Size GetPreferredSize() OVERRIDE; |
33 | 33 |
34 private: | 34 private: |
35 int width_; | 35 int width_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(FixedWidthLabel); | 37 DISALLOW_COPY_AND_ASSIGN(FixedWidthLabel); |
38 }; | 38 }; |
39 | 39 |
40 FixedWidthLabel::FixedWidthLabel(const string16& text, int width) | 40 FixedWidthLabel::FixedWidthLabel(const base::string16& text, int width) |
41 : Label(text), | 41 : Label(text), |
42 width_(width) { | 42 width_(width) { |
43 SetHorizontalAlignment(gfx::ALIGN_LEFT); | 43 SetHorizontalAlignment(gfx::ALIGN_LEFT); |
44 SetMultiLine(true); | 44 SetMultiLine(true); |
45 } | 45 } |
46 | 46 |
47 FixedWidthLabel::~FixedWidthLabel() { | 47 FixedWidthLabel::~FixedWidthLabel() { |
48 } | 48 } |
49 | 49 |
50 gfx::Size FixedWidthLabel::GetPreferredSize() { | 50 gfx::Size FixedWidthLabel::GetPreferredSize() { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 bool IdleActionWarningDialogView::Cancel() { | 87 bool IdleActionWarningDialogView::Cancel() { |
88 return closing_; | 88 return closing_; |
89 } | 89 } |
90 | 90 |
91 IdleActionWarningDialogView::~IdleActionWarningDialogView() { | 91 IdleActionWarningDialogView::~IdleActionWarningDialogView() { |
92 } | 92 } |
93 | 93 |
94 } // namespace chromeos | 94 } // namespace chromeos |
OLD | NEW |