| 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/system/chromeos/session/logout_confirmation_dialog.h" | 5 #include "ash/system/chromeos/session/logout_confirmation_dialog.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 8 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return l10n_util::GetStringUTF16(IDS_ASH_LOGOUT_CONFIRMATION_TITLE); | 77 return l10n_util::GetStringUTF16(IDS_ASH_LOGOUT_CONFIRMATION_TITLE); |
| 78 } | 78 } |
| 79 | 79 |
| 80 base::string16 LogoutConfirmationDialog::GetDialogButtonLabel( | 80 base::string16 LogoutConfirmationDialog::GetDialogButtonLabel( |
| 81 ui::DialogButton button) const { | 81 ui::DialogButton button) const { |
| 82 if (button == ui::DIALOG_BUTTON_OK) | 82 if (button == ui::DIALOG_BUTTON_OK) |
| 83 return l10n_util::GetStringUTF16(IDS_ASH_LOGOUT_CONFIRMATION_BUTTON); | 83 return l10n_util::GetStringUTF16(IDS_ASH_LOGOUT_CONFIRMATION_BUTTON); |
| 84 return views::DialogDelegateView::GetDialogButtonLabel(button); | 84 return views::DialogDelegateView::GetDialogButtonLabel(button); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void LogoutConfirmationDialog::OnClosed() { | 87 void LogoutConfirmationDialog::WindowClosing() { |
| 88 update_timer_.Stop(); | 88 update_timer_.Stop(); |
| 89 controller_->OnDialogClosed(); | 89 controller_->OnDialogClosed(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void LogoutConfirmationDialog::DeleteDelegate() { | |
| 93 delete this; | |
| 94 } | |
| 95 | |
| 96 void LogoutConfirmationDialog::UpdateLabel() { | 92 void LogoutConfirmationDialog::UpdateLabel() { |
| 97 const base::TimeDelta time_remaining = | 93 const base::TimeDelta time_remaining = |
| 98 logout_time_ - controller_->clock()->NowTicks(); | 94 logout_time_ - controller_->clock()->NowTicks(); |
| 99 if (time_remaining >= base::TimeDelta::FromMilliseconds(kHalfSecondInMs)) { | 95 if (time_remaining >= base::TimeDelta::FromMilliseconds(kHalfSecondInMs)) { |
| 100 label_->SetText(l10n_util::GetStringFUTF16( | 96 label_->SetText(l10n_util::GetStringFUTF16( |
| 101 IDS_ASH_LOGOUT_CONFIRMATION_WARNING, | 97 IDS_ASH_LOGOUT_CONFIRMATION_WARNING, |
| 102 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, | 98 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, |
| 103 ui::TimeFormat::LENGTH_LONG, | 99 ui::TimeFormat::LENGTH_LONG, |
| 104 10, | 100 10, |
| 105 time_remaining))); | 101 time_remaining))); |
| 106 } else { | 102 } else { |
| 107 label_->SetText(l10n_util::GetStringUTF16( | 103 label_->SetText(l10n_util::GetStringUTF16( |
| 108 IDS_ASH_LOGOUT_CONFIRMATION_WARNING_NOW)); | 104 IDS_ASH_LOGOUT_CONFIRMATION_WARNING_NOW)); |
| 109 update_timer_.Stop(); | 105 update_timer_.Stop(); |
| 110 } | 106 } |
| 111 } | 107 } |
| 112 | 108 |
| 113 } // namespace ash | 109 } // namespace ash |
| OLD | NEW |