OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/app_mode/app_session_lifetime.h" | 5 #include "chrome/browser/chromeos/app_mode/app_session_lifetime.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
13 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_service.h" | 14 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_service.h" |
14 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" | 15 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" |
15 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 16 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
16 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 17 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
17 #include "chrome/browser/lifetime/application_lifetime.h" | 18 #include "chrome/browser/lifetime/application_lifetime.h" |
18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
21 #include "chrome/browser/ui/browser_list_observer.h" | 22 #include "chrome/browser/ui/browser_list_observer.h" |
22 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 user_manager::UserManager::Get()->GetActiveUser()->email())) | 134 user_manager::UserManager::Get()->GetActiveUser()->email())) |
134 return; | 135 return; |
135 | 136 |
136 // Set the app_id for the current instance of KioskAppUpdateService. | 137 // Set the app_id for the current instance of KioskAppUpdateService. |
137 KioskAppUpdateService* update_service = | 138 KioskAppUpdateService* update_service = |
138 KioskAppUpdateServiceFactory::GetForProfile(profile); | 139 KioskAppUpdateServiceFactory::GetForProfile(profile); |
139 DCHECK(update_service); | 140 DCHECK(update_service); |
140 if (update_service) | 141 if (update_service) |
141 update_service->set_app_id(app_id); | 142 update_service->set_app_id(app_id); |
142 | 143 |
| 144 // Start to monitor external update from usb stick. |
| 145 KioskAppManager::Get()->MonitorKioskExternalUpdate(); |
| 146 |
143 // If the device is not enterprise managed, set prefs to reboot after update | 147 // If the device is not enterprise managed, set prefs to reboot after update |
144 // and create a user security message which shows the user the application | 148 // and create a user security message which shows the user the application |
145 // name and author after some idle timeout. | 149 // name and author after some idle timeout. |
146 policy::BrowserPolicyConnectorChromeOS* connector = | 150 policy::BrowserPolicyConnectorChromeOS* connector = |
147 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 151 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
148 if (!connector->IsEnterpriseManaged()) { | 152 if (!connector->IsEnterpriseManaged()) { |
149 PrefService* local_state = g_browser_process->local_state(); | 153 PrefService* local_state = g_browser_process->local_state(); |
150 local_state->SetBoolean(prefs::kRebootAfterUpdate, true); | 154 local_state->SetBoolean(prefs::kRebootAfterUpdate, true); |
151 KioskModeIdleAppNameNotification::Initialize(); | 155 KioskModeIdleAppNameNotification::Initialize(); |
152 } | 156 } |
153 } | 157 } |
154 | 158 |
155 } // namespace chromeos | 159 } // namespace chromeos |
OLD | NEW |