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/time.h" | 10 #include "base/time.h" |
11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_metrics.h" | |
14 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 13 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
15 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
16 #include "chromeos/dbus/dbus_thread_manager.h" | 15 #include "chromeos/dbus/dbus_thread_manager.h" |
17 #include "chromeos/dbus/session_manager_client.h" | 16 #include "chromeos/dbus/session_manager_client.h" |
18 #include "grit/browser_resources.h" | 17 #include "grit/browser_resources.h" |
19 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
20 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
22 #include "ui/views/controls/label.h" | 21 #include "ui/views/controls/label.h" |
23 #include "ui/views/layout/grid_layout.h" | 22 #include "ui/views/layout/grid_layout.h" |
(...skipping 24 matching lines...) Expand all Loading... |
48 | 47 |
49 base::TimeDelta IdleLogoutSettingsProvider::GetCountdownUpdateInterval() { | 48 base::TimeDelta IdleLogoutSettingsProvider::GetCountdownUpdateInterval() { |
50 return base::TimeDelta::FromMilliseconds(kCountdownUpdateIntervalMs); | 49 return base::TimeDelta::FromMilliseconds(kCountdownUpdateIntervalMs); |
51 } | 50 } |
52 | 51 |
53 KioskModeSettings* IdleLogoutSettingsProvider::GetKioskModeSettings() { | 52 KioskModeSettings* IdleLogoutSettingsProvider::GetKioskModeSettings() { |
54 return KioskModeSettings::Get(); | 53 return KioskModeSettings::Get(); |
55 } | 54 } |
56 | 55 |
57 void IdleLogoutSettingsProvider::LogoutCurrentUser(IdleLogoutDialogView*) { | 56 void IdleLogoutSettingsProvider::LogoutCurrentUser(IdleLogoutDialogView*) { |
58 KioskModeMetrics::Get()->SessionEnded(); | |
59 DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); | 57 DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); |
60 } | 58 } |
61 | 59 |
62 //////////////////////////////////////////////////////////////////////////////// | 60 //////////////////////////////////////////////////////////////////////////////// |
63 // IdleLogoutDialogView public static methods | 61 // IdleLogoutDialogView public static methods |
64 // static | 62 // static |
65 void IdleLogoutDialogView::ShowDialog() { | 63 void IdleLogoutDialogView::ShowDialog() { |
66 // We only show the dialog if it is not already showing. We don't want two | 64 // We only show the dialog if it is not already showing. We don't want two |
67 // countdowns on the screen for any reason. If the dialog is closed by using | 65 // countdowns on the screen for any reason. If the dialog is closed by using |
68 // CloseDialog, we reset g_instance so the next Show will work correctly; in | 66 // CloseDialog, we reset g_instance so the next Show will work correctly; in |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 return g_instance; | 211 return g_instance; |
214 } | 212 } |
215 | 213 |
216 // static | 214 // static |
217 void IdleLogoutDialogView::set_settings_provider( | 215 void IdleLogoutDialogView::set_settings_provider( |
218 IdleLogoutSettingsProvider* provider) { | 216 IdleLogoutSettingsProvider* provider) { |
219 provider_ = provider; | 217 provider_ = provider; |
220 } | 218 } |
221 | 219 |
222 } // namespace chromeos | 220 } // namespace chromeos |
OLD | NEW |