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 "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 static void ShowDialog(const base::Callback<void(bool)> on_accept); | 37 static void ShowDialog(const base::Callback<void(bool)> on_accept); |
38 | 38 |
39 // views::DialogDelegate overrides. | 39 // views::DialogDelegate overrides. |
40 virtual bool Accept() OVERRIDE; | 40 virtual bool Accept() OVERRIDE; |
41 | 41 |
42 // views::WidgetDelegate overrides. | 42 // views::WidgetDelegate overrides. |
43 virtual ui::ModalType GetModalType() const OVERRIDE; | 43 virtual ui::ModalType GetModalType() const OVERRIDE; |
44 | 44 |
45 // views::View overrides. | 45 // views::View overrides. |
46 virtual gfx::Size GetPreferredSize() OVERRIDE; | 46 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
47 | 47 |
48 private: | 48 private: |
49 void InitDialog(); | 49 void InitDialog(); |
50 | 50 |
51 scoped_ptr<views::Checkbox> no_show_checkbox_; | 51 scoped_ptr<views::Checkbox> no_show_checkbox_; |
52 const base::Callback<void(bool)> on_accept_; | 52 const base::Callback<void(bool)> on_accept_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(TeleportWarningView); | 54 DISALLOW_COPY_AND_ASSIGN(TeleportWarningView); |
55 }; | 55 }; |
56 | 56 |
(...skipping 23 matching lines...) Expand all Loading... |
80 | 80 |
81 bool TeleportWarningView::Accept() { | 81 bool TeleportWarningView::Accept() { |
82 on_accept_.Run(no_show_checkbox_->checked()); | 82 on_accept_.Run(no_show_checkbox_->checked()); |
83 return true; | 83 return true; |
84 } | 84 } |
85 | 85 |
86 ui::ModalType TeleportWarningView::GetModalType() const { | 86 ui::ModalType TeleportWarningView::GetModalType() const { |
87 return ui::MODAL_TYPE_SYSTEM; | 87 return ui::MODAL_TYPE_SYSTEM; |
88 } | 88 } |
89 | 89 |
90 gfx::Size TeleportWarningView::GetPreferredSize() { | 90 gfx::Size TeleportWarningView::GetPreferredSize() const { |
91 return gfx::Size(kDefaultWidth, kDefaultHeight); | 91 return gfx::Size(kDefaultWidth, kDefaultHeight); |
92 } | 92 } |
93 | 93 |
94 void TeleportWarningView::InitDialog() { | 94 void TeleportWarningView::InitDialog() { |
95 const gfx::Insets kDialogInsets(kTopInset, kInset, kInset, kInset); | 95 const gfx::Insets kDialogInsets(kTopInset, kInset, kInset, kInset); |
96 | 96 |
97 // Create the views and layout manager and set them up. | 97 // Create the views and layout manager and set them up. |
98 views::GridLayout* grid_layout = views::GridLayout::CreatePanel(this); | 98 views::GridLayout* grid_layout = views::GridLayout::CreatePanel(this); |
99 grid_layout->SetInsets(kDialogInsets); | 99 grid_layout->SetInsets(kDialogInsets); |
100 | 100 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 //////////////////////////////////////////////////////////////////////////////// | 155 //////////////////////////////////////////////////////////////////////////////// |
156 // Factory function. | 156 // Factory function. |
157 | 157 |
158 void ShowMultiprofilesWarningDialog( | 158 void ShowMultiprofilesWarningDialog( |
159 const base::Callback<void(bool)> on_accept) { | 159 const base::Callback<void(bool)> on_accept) { |
160 TeleportWarningView::ShowDialog(on_accept); | 160 TeleportWarningView::ShowDialog(on_accept); |
161 } | 161 } |
162 | 162 |
163 } // namespace chromeos | 163 } // namespace chromeos |
OLD | NEW |