| 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/ui/ash/multi_user/multi_user_warning_dialog.h" | 5 #include "chrome/browser/ui/ash/multi_user/multi_user_warning_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_VISIT_DESKTOP_WARNING_TITLE); | 97 return l10n_util::GetStringUTF16(IDS_VISIT_DESKTOP_WARNING_TITLE); |
| 98 } | 98 } |
| 99 | 99 |
| 100 gfx::Size TeleportWarningView::GetPreferredSize() const { | 100 gfx::Size TeleportWarningView::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 TeleportWarningView::InitDialog() { | 106 void TeleportWarningView::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_VISIT_DESKTOP_WARNING_MESSAGE)); | 114 l10n_util::GetStringUTF16(IDS_VISIT_DESKTOP_WARNING_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 ShowMultiprofilesWarningDialog( | 125 void ShowMultiprofilesWarningDialog( |
| 126 const base::Callback<void(bool)>& on_accept) { | 126 const base::Callback<void(bool)>& on_accept) { |
| 127 TeleportWarningView::ShowDialog(on_accept); | 127 TeleportWarningView::ShowDialog(on_accept); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace chromeos | 130 } // namespace chromeos |
| OLD | NEW |