| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/ui/idle_logout_dialog_view.h" | 5 #include "chrome/browser/chromeos/ui/idle_logout_dialog_view.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 void IdleLogoutDialogView::Show() { | 142 void IdleLogoutDialogView::Show() { |
| 143 KioskModeSettings* settings = | 143 KioskModeSettings* settings = |
| 144 IdleLogoutDialogView::provider_->GetKioskModeSettings(); | 144 IdleLogoutDialogView::provider_->GetKioskModeSettings(); |
| 145 | 145 |
| 146 // Setup the countdown label before showing. | 146 // Setup the countdown label before showing. |
| 147 countdown_end_time_ = base::Time::Now() + | 147 countdown_end_time_ = base::Time::Now() + |
| 148 settings->GetIdleLogoutWarningDuration(); | 148 settings->GetIdleLogoutWarningDuration(); |
| 149 | 149 |
| 150 UpdateCountdown(); | 150 UpdateCountdown(); |
| 151 | 151 |
| 152 views::Widget::CreateWindowWithContext(this, | 152 views::DialogDelegate::CreateDialogWidget( |
| 153 ash::Shell::GetPrimaryRootWindow()); | 153 this, ash::Shell::GetPrimaryRootWindow(), NULL); |
| 154 GetWidget()->SetAlwaysOnTop(true); | 154 GetWidget()->SetAlwaysOnTop(true); |
| 155 GetWidget()->Show(); | 155 GetWidget()->Show(); |
| 156 | 156 |
| 157 // Update countdown every 1 second. | 157 // Update countdown every 1 second. |
| 158 timer_.Start(FROM_HERE, | 158 timer_.Start(FROM_HERE, |
| 159 IdleLogoutDialogView::provider_->GetCountdownUpdateInterval(), | 159 IdleLogoutDialogView::provider_->GetCountdownUpdateInterval(), |
| 160 this, | 160 this, |
| 161 &IdleLogoutDialogView::UpdateCountdown); | 161 &IdleLogoutDialogView::UpdateCountdown); |
| 162 } | 162 } |
| 163 | 163 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 return g_instance; | 202 return g_instance; |
| 203 } | 203 } |
| 204 | 204 |
| 205 // static | 205 // static |
| 206 void IdleLogoutDialogView::set_settings_provider( | 206 void IdleLogoutDialogView::set_settings_provider( |
| 207 IdleLogoutSettingsProvider* provider) { | 207 IdleLogoutSettingsProvider* provider) { |
| 208 provider_ = provider; | 208 provider_ = provider; |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace chromeos | 211 } // namespace chromeos |
| OLD | NEW |