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

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

Issue 148083014: ExtensionSystem cleanup part 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac Created 6 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 | 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/kiosk_app_update_service.h" 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_service.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/app_mode/app_mode_utils.h" 8 #include "chrome/browser/app_mode/app_mode_utils.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/browser_process_platform_part_chromeos.h" 10 #include "chrome/browser/browser_process_platform_part_chromeos.h"
11 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 11 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
12 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h" 12 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h"
13 #include "chrome/browser/extensions/api/runtime/runtime_api.h" 13 #include "chrome/browser/extensions/api/runtime/runtime_api.h"
14 #include "chrome/browser/extensions/extension_service.h" 14 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/browser/extensions/extension_system_factory.h"
16 #include "chrome/browser/lifetime/application_lifetime.h" 15 #include "chrome/browser/lifetime/application_lifetime.h"
17 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
18 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 17 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
19 #include "extensions/browser/extension_system.h" 18 #include "extensions/browser/extension_system.h"
19 #include "extensions/browser/extension_system_provider.h"
20 #include "extensions/browser/extensions_browser_client.h"
20 #include "extensions/common/extension.h" 21 #include "extensions/common/extension.h"
21 22
22 namespace chromeos { 23 namespace chromeos {
23 24
24 namespace { 25 namespace {
25 26
26 // How low to wait after an update is available before we force a restart. 27 // How low to wait after an update is available before we force a restart.
27 const int kForceRestartWaitTimeMs = 24 * 3600 * 1000; // 24 hours. 28 const int kForceRestartWaitTimeMs = 24 * 3600 * 1000; // 24 hours.
28 29
29 } // namespace 30 } // namespace
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 110
110 void KioskAppUpdateService::WillDestroyAutomaticRebootManager() { 111 void KioskAppUpdateService::WillDestroyAutomaticRebootManager() {
111 automatic_reboot_manager_->RemoveObserver(this); 112 automatic_reboot_manager_->RemoveObserver(this);
112 automatic_reboot_manager_ = NULL; 113 automatic_reboot_manager_ = NULL;
113 } 114 }
114 115
115 KioskAppUpdateServiceFactory::KioskAppUpdateServiceFactory() 116 KioskAppUpdateServiceFactory::KioskAppUpdateServiceFactory()
116 : BrowserContextKeyedServiceFactory( 117 : BrowserContextKeyedServiceFactory(
117 "KioskAppUpdateService", 118 "KioskAppUpdateService",
118 BrowserContextDependencyManager::GetInstance()) { 119 BrowserContextDependencyManager::GetInstance()) {
119 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); 120 DependsOn(
121 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
120 } 122 }
121 123
122 KioskAppUpdateServiceFactory::~KioskAppUpdateServiceFactory() { 124 KioskAppUpdateServiceFactory::~KioskAppUpdateServiceFactory() {
123 } 125 }
124 126
125 // static 127 // static
126 KioskAppUpdateService* KioskAppUpdateServiceFactory::GetForProfile( 128 KioskAppUpdateService* KioskAppUpdateServiceFactory::GetForProfile(
127 Profile* profile) { 129 Profile* profile) {
128 // This should never be called unless we are running in forced app mode. 130 // This should never be called unless we are running in forced app mode.
129 DCHECK(chrome::IsRunningInForcedAppMode()); 131 DCHECK(chrome::IsRunningInForcedAppMode());
(...skipping 11 matching lines...) Expand all
141 143
142 BrowserContextKeyedService* 144 BrowserContextKeyedService*
143 KioskAppUpdateServiceFactory::BuildServiceInstanceFor( 145 KioskAppUpdateServiceFactory::BuildServiceInstanceFor(
144 content::BrowserContext* context) const { 146 content::BrowserContext* context) const {
145 return new KioskAppUpdateService( 147 return new KioskAppUpdateService(
146 Profile::FromBrowserContext(context), 148 Profile::FromBrowserContext(context),
147 g_browser_process->platform_part()->automatic_reboot_manager()); 149 g_browser_process->platform_part()->automatic_reboot_manager());
148 } 150 }
149 151
150 } // namespace chromeos 152 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/extension_app_provider.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_diagnosis_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698