OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/multiprofiles_intro_dialog.h" | 5 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_HEADLINE); | 97 return l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_HEADLINE); |
98 } | 98 } |
99 | 99 |
100 gfx::Size MultiprofilesIntroView::GetPreferredSize() const { | 100 gfx::Size MultiprofilesIntroView::GetPreferredSize() const { |
101 return gfx::Size( | 101 return gfx::Size( |
102 kDefaultWidth, | 102 kDefaultWidth, |
103 GetLayoutManager()->GetPreferredHeightForWidth(this, kDefaultWidth)); | 103 GetLayoutManager()->GetPreferredHeightForWidth(this, kDefaultWidth)); |
104 } | 104 } |
105 | 105 |
106 void MultiprofilesIntroView::InitDialog() { | 106 void MultiprofilesIntroView::InitDialog() { |
107 SetBorder(views::Border::CreateEmptyBorder(views::kPanelVertMargin, | 107 SetBorder(views::CreateEmptyBorder(views::kPanelVertMargin, |
108 views::kButtonHEdgeMarginNew, 0, | 108 views::kButtonHEdgeMarginNew, 0, |
109 views::kButtonHEdgeMarginNew)); | 109 views::kButtonHEdgeMarginNew)); |
110 SetLayoutManager(new views::FillLayout()); | 110 SetLayoutManager(new views::FillLayout()); |
111 | 111 |
112 // Explanation string | 112 // Explanation string |
113 views::Label* label = new views::Label( | 113 views::Label* label = new views::Label( |
114 l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_MESSAGE)); | 114 l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_MESSAGE)); |
115 label->SetMultiLine(true); | 115 label->SetMultiLine(true); |
116 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 116 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
117 AddChildView(label); | 117 AddChildView(label); |
118 } | 118 } |
119 | 119 |
120 } // namespace | 120 } // namespace |
121 | 121 |
122 //////////////////////////////////////////////////////////////////////////////// | 122 //////////////////////////////////////////////////////////////////////////////// |
123 // Factory function. | 123 // Factory function. |
124 | 124 |
125 void ShowMultiprofilesIntroDialog(const base::Callback<void(bool)> on_accept) { | 125 void ShowMultiprofilesIntroDialog(const base::Callback<void(bool)> on_accept) { |
126 MultiprofilesIntroView::ShowDialog(on_accept); | 126 MultiprofilesIntroView::ShowDialog(on_accept); |
127 } | 127 } |
128 | 128 |
129 } // namespace chromeos | 129 } // namespace chromeos |
OLD | NEW |