| 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/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" | 
|  | 10 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.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/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" | 
| 13 #include "ui/views/border.h" | 14 #include "ui/views/border.h" | 
| 14 #include "ui/views/controls/button/checkbox.h" | 15 #include "ui/views/controls/button/checkbox.h" | 
| 15 #include "ui/views/controls/label.h" | 16 #include "ui/views/controls/label.h" | 
| 16 #include "ui/views/layout/fill_layout.h" | 17 #include "ui/views/layout/fill_layout.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_delegate.h" | 19 #include "ui/views/window/dialog_delegate.h" | 
| 20 | 20 | 
| 21 namespace chromeos { | 21 namespace chromeos { | 
| 22 | 22 | 
| 23 namespace { | 23 namespace { | 
| 24 | 24 | 
| 25 // Default width of the dialog. | 25 // Default width of the dialog. | 
| 26 const int kDefaultWidth = 448; | 26 const int kDefaultWidth = 448; | 
| 27 | 27 | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 99   return l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_HEADLINE); | 99   return l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_HEADLINE); | 
| 100 } | 100 } | 
| 101 | 101 | 
| 102 gfx::Size MultiprofilesIntroView::CalculatePreferredSize() const { | 102 gfx::Size MultiprofilesIntroView::CalculatePreferredSize() const { | 
| 103   return gfx::Size( | 103   return gfx::Size( | 
| 104       kDefaultWidth, | 104       kDefaultWidth, | 
| 105       GetLayoutManager()->GetPreferredHeightForWidth(this, kDefaultWidth)); | 105       GetLayoutManager()->GetPreferredHeightForWidth(this, kDefaultWidth)); | 
| 106 } | 106 } | 
| 107 | 107 | 
| 108 void MultiprofilesIntroView::InitDialog() { | 108 void MultiprofilesIntroView::InitDialog() { | 
| 109   SetBorder(views::CreateEmptyBorder(views::kPanelVertMargin, | 109   SetBorder( | 
| 110                                      views::kButtonHEdgeMarginNew, 0, | 110       views::CreateEmptyBorder(ChromeLayoutProvider::Get()->GetInsetsMetric( | 
| 111                                      views::kButtonHEdgeMarginNew)); | 111           views::INSETS_DIALOG_TITLE))); | 
| 112   SetLayoutManager(new views::FillLayout()); | 112   SetLayoutManager(new views::FillLayout()); | 
| 113 | 113 | 
| 114   // Explanation string | 114   // Explanation string | 
| 115   views::Label* label = new views::Label( | 115   views::Label* label = new views::Label( | 
| 116       l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_MESSAGE)); | 116       l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_MESSAGE)); | 
| 117   label->SetMultiLine(true); | 117   label->SetMultiLine(true); | 
| 118   label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 118   label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 
| 119   AddChildView(label); | 119   AddChildView(label); | 
| 120 } | 120 } | 
| 121 | 121 | 
| 122 }  // namespace | 122 }  // namespace | 
| 123 | 123 | 
| 124 //////////////////////////////////////////////////////////////////////////////// | 124 //////////////////////////////////////////////////////////////////////////////// | 
| 125 // Factory function. | 125 // Factory function. | 
| 126 | 126 | 
| 127 void ShowMultiprofilesIntroDialog(const base::Callback<void(bool)> on_accept) { | 127 void ShowMultiprofilesIntroDialog(const base::Callback<void(bool)> on_accept) { | 
| 128   MultiprofilesIntroView::ShowDialog(on_accept); | 128   MultiprofilesIntroView::ShowDialog(on_accept); | 
| 129 } | 129 } | 
| 130 | 130 | 
| 131 }  // namespace chromeos | 131 }  // namespace chromeos | 
| OLD | NEW | 
|---|