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 "ash/common/system/chromeos/session/logout_confirmation_dialog.h" | 5 #include "ash/common/system/chromeos/session/logout_confirmation_dialog.h" |
6 | 6 |
7 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" | 7 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" |
8 #include "ash/common/system/tray/tray_constants.h" | 8 #include "ash/common/system/tray/tray_constants.h" |
9 #include "ash/common/wm_root_window_controller.h" | 9 #include "ash/common/wm_root_window_controller.h" |
10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 LogoutConfirmationDialog::LogoutConfirmationDialog( | 35 LogoutConfirmationDialog::LogoutConfirmationDialog( |
36 LogoutConfirmationController* controller, | 36 LogoutConfirmationController* controller, |
37 base::TimeTicks logout_time) | 37 base::TimeTicks logout_time) |
38 : controller_(controller), logout_time_(logout_time) { | 38 : controller_(controller), logout_time_(logout_time) { |
39 SetLayoutManager(new views::FillLayout()); | 39 SetLayoutManager(new views::FillLayout()); |
40 | 40 |
41 label_ = new views::Label; | 41 label_ = new views::Label; |
42 label_->SetBorder(views::Border::CreateEmptyBorder( | 42 label_->SetBorder(views::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, |
43 0, kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingHorizontal)); | 43 kTrayPopupPaddingHorizontal)); |
44 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 44 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
45 label_->SetMultiLine(true); | 45 label_->SetMultiLine(true); |
46 AddChildView(label_); | 46 AddChildView(label_); |
47 | 47 |
48 UpdateLabel(); | 48 UpdateLabel(); |
49 | 49 |
50 views::Widget* widget = new views::Widget; | 50 views::Widget* widget = new views::Widget; |
51 views::Widget::InitParams params = | 51 views::Widget::InitParams params = |
52 GetDialogWidgetInitParams(this, nullptr, nullptr, gfx::Rect()); | 52 GetDialogWidgetInitParams(this, nullptr, nullptr, gfx::Rect()); |
53 WmShell::Get() | 53 WmShell::Get() |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 ui::TimeFormat::LENGTH_LONG, 10, | 113 ui::TimeFormat::LENGTH_LONG, 10, |
114 time_remaining))); | 114 time_remaining))); |
115 } else { | 115 } else { |
116 label_->SetText( | 116 label_->SetText( |
117 l10n_util::GetStringUTF16(IDS_ASH_LOGOUT_CONFIRMATION_WARNING_NOW)); | 117 l10n_util::GetStringUTF16(IDS_ASH_LOGOUT_CONFIRMATION_WARNING_NOW)); |
118 update_timer_.Stop(); | 118 update_timer_.Stop(); |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 } // namespace ash | 122 } // namespace ash |
OLD | NEW |