Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: ash/system/chromeos/session/logout_confirmation_dialog.cc

Issue 1730893002: Revert of Remove DialogDelegate::OnClosed() which is redundant with (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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::WindowClosing() { 87 void LogoutConfirmationDialog::OnClosed() {
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
92 void LogoutConfirmationDialog::UpdateLabel() { 96 void LogoutConfirmationDialog::UpdateLabel() {
93 const base::TimeDelta time_remaining = 97 const base::TimeDelta time_remaining =
94 logout_time_ - controller_->clock()->NowTicks(); 98 logout_time_ - controller_->clock()->NowTicks();
95 if (time_remaining >= base::TimeDelta::FromMilliseconds(kHalfSecondInMs)) { 99 if (time_remaining >= base::TimeDelta::FromMilliseconds(kHalfSecondInMs)) {
96 label_->SetText(l10n_util::GetStringFUTF16( 100 label_->SetText(l10n_util::GetStringFUTF16(
97 IDS_ASH_LOGOUT_CONFIRMATION_WARNING, 101 IDS_ASH_LOGOUT_CONFIRMATION_WARNING,
98 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION, 102 ui::TimeFormat::Detailed(ui::TimeFormat::FORMAT_DURATION,
99 ui::TimeFormat::LENGTH_LONG, 103 ui::TimeFormat::LENGTH_LONG,
100 10, 104 10,
101 time_remaining))); 105 time_remaining)));
102 } else { 106 } else {
103 label_->SetText(l10n_util::GetStringUTF16( 107 label_->SetText(l10n_util::GetStringUTF16(
104 IDS_ASH_LOGOUT_CONFIRMATION_WARNING_NOW)); 108 IDS_ASH_LOGOUT_CONFIRMATION_WARNING_NOW));
105 update_timer_.Stop(); 109 update_timer_.Stop();
106 } 110 }
107 } 111 }
108 112
109 } // namespace ash 113 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/session/logout_confirmation_dialog.h ('k') | chrome/browser/chromeos/enrollment_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698