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

Side by Side Diff: chrome/browser/chromeos/app_mode/app_session_lifetime.cc

Issue 491403003: Update cached kiosk app crx from usb stick. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the refcounted implementation KioskExternalUpdater. Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
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 "apps/app_window.h" 7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/prefs/pref_service.h" 13 #include "base/prefs/pref_service.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
15 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_service.h" 16 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_service.h"
16 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification .h" 17 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification .h"
17 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" 18 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h"
18 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 19 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
19 #include "chrome/browser/lifetime/application_lifetime.h" 20 #include "chrome/browser/lifetime/application_lifetime.h"
20 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
22 #include "chrome/browser/ui/browser_list.h" 23 #include "chrome/browser/ui/browser_list.h"
23 #include "chrome/browser/ui/browser_list_observer.h" 24 #include "chrome/browser/ui/browser_list_observer.h"
24 #include "chrome/browser/ui/browser_window.h" 25 #include "chrome/browser/ui/browser_window.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 user_manager::UserManager::Get()->GetActiveUser()->email())) 133 user_manager::UserManager::Get()->GetActiveUser()->email()))
133 return; 134 return;
134 135
135 // Set the app_id for the current instance of KioskAppUpdateService. 136 // Set the app_id for the current instance of KioskAppUpdateService.
136 KioskAppUpdateService* update_service = 137 KioskAppUpdateService* update_service =
137 KioskAppUpdateServiceFactory::GetForProfile(profile); 138 KioskAppUpdateServiceFactory::GetForProfile(profile);
138 DCHECK(update_service); 139 DCHECK(update_service);
139 if (update_service) 140 if (update_service)
140 update_service->set_app_id(app_id); 141 update_service->set_app_id(app_id);
141 142
143 // Start to monitor external update from usb stick.
144 KioskAppManager::Get()->MonitorKioskExternalUpdate();
145
142 // If the device is not enterprise managed, set prefs to reboot after update 146 // If the device is not enterprise managed, set prefs to reboot after update
143 // and create a user security message which shows the user the application 147 // and create a user security message which shows the user the application
144 // name and author after some idle timeout. 148 // name and author after some idle timeout.
145 policy::BrowserPolicyConnectorChromeOS* connector = 149 policy::BrowserPolicyConnectorChromeOS* connector =
146 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 150 g_browser_process->platform_part()->browser_policy_connector_chromeos();
147 if (!connector->IsEnterpriseManaged()) { 151 if (!connector->IsEnterpriseManaged()) {
148 PrefService* local_state = g_browser_process->local_state(); 152 PrefService* local_state = g_browser_process->local_state();
149 local_state->SetBoolean(prefs::kRebootAfterUpdate, true); 153 local_state->SetBoolean(prefs::kRebootAfterUpdate, true);
150 KioskModeIdleAppNameNotification::Initialize(); 154 KioskModeIdleAppNameNotification::Initialize();
151 } 155 }
152 } 156 }
153 157
154 } // namespace chromeos 158 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698