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/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" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // Setup timer to force restart once the wait period expires. | 50 // Setup timer to force restart once the wait period expires. |
51 restart_timer_.Start( | 51 restart_timer_.Start( |
52 FROM_HERE, base::TimeDelta::FromMilliseconds(kForceRestartWaitTimeMs), | 52 FROM_HERE, base::TimeDelta::FromMilliseconds(kForceRestartWaitTimeMs), |
53 this, &KioskAppUpdateService::ForceAppUpdateRestart); | 53 this, &KioskAppUpdateService::ForceAppUpdateRestart); |
54 } | 54 } |
55 | 55 |
56 void KioskAppUpdateService::ForceAppUpdateRestart() { | 56 void KioskAppUpdateService::ForceAppUpdateRestart() { |
57 // Force a chrome restart (not a logout or reboot) by closing all browsers. | 57 // Force a chrome restart (not a logout or reboot) by closing all browsers. |
58 LOG(WARNING) << "Force closing all browsers to update kiosk app."; | 58 LOG(WARNING) << "Force closing all browsers to update kiosk app."; |
59 chrome::CloseAllBrowsers(); | 59 chrome::CloseAllBrowsersAndQuit(); |
60 } | 60 } |
61 | 61 |
62 void KioskAppUpdateService::Shutdown() { | 62 void KioskAppUpdateService::Shutdown() { |
63 ExtensionService* service = profile_->GetExtensionService(); | 63 ExtensionService* service = profile_->GetExtensionService(); |
64 if (service) | 64 if (service) |
65 service->RemoveUpdateObserver(this); | 65 service->RemoveUpdateObserver(this); |
66 } | 66 } |
67 | 67 |
68 void KioskAppUpdateService::OnAppUpdateAvailable(const std::string& app_id) { | 68 void KioskAppUpdateService::OnAppUpdateAvailable(const std::string& app_id) { |
69 DCHECK(!app_id_.empty()); | 69 DCHECK(!app_id_.empty()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 BrowserContextKeyedService* | 134 BrowserContextKeyedService* |
135 KioskAppUpdateServiceFactory::BuildServiceInstanceFor( | 135 KioskAppUpdateServiceFactory::BuildServiceInstanceFor( |
136 content::BrowserContext* context) const { | 136 content::BrowserContext* context) const { |
137 return new KioskAppUpdateService( | 137 return new KioskAppUpdateService( |
138 Profile::FromBrowserContext(context), | 138 Profile::FromBrowserContext(context), |
139 g_browser_process->platform_part()->automatic_reboot_manager()); | 139 g_browser_process->platform_part()->automatic_reboot_manager()); |
140 } | 140 } |
141 | 141 |
142 } // namespace chromeos | 142 } // namespace chromeos |
OLD | NEW |