OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.h" | 5 #include "chrome/browser/chromeos/app_mode/app_session.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 private: | 115 private: |
116 // extensions::AppWindowRegistry::Observer overrides: | 116 // extensions::AppWindowRegistry::Observer overrides: |
117 void OnAppWindowAdded(AppWindow* app_window) override { | 117 void OnAppWindowAdded(AppWindow* app_window) override { |
118 app_session_->OnAppWindowAdded(app_window); | 118 app_session_->OnAppWindowAdded(app_window); |
119 } | 119 } |
120 | 120 |
121 void OnAppWindowRemoved(AppWindow* app_window) override { | 121 void OnAppWindowRemoved(AppWindow* app_window) override { |
122 if (window_registry_->GetAppWindowsForApp(app_id_).empty()) { | 122 if (window_registry_->GetAppWindowsForApp(app_id_).empty()) { |
123 if (DemoAppLauncher::IsDemoAppSession( | 123 if (DemoAppLauncher::IsDemoAppSession(user_manager::UserManager::Get() |
124 user_manager::UserManager::Get()->GetActiveUser()->email())) { | 124 ->GetActiveUser() |
| 125 ->GetAccountId())) { |
125 // If we were in demo mode, we disabled all our network technologies, | 126 // If we were in demo mode, we disabled all our network technologies, |
126 // re-enable them. | 127 // re-enable them. |
127 NetworkStateHandler* handler = | 128 NetworkStateHandler* handler = |
128 NetworkHandler::Get()->network_state_handler(); | 129 NetworkHandler::Get()->network_state_handler(); |
129 handler->SetTechnologyEnabled( | 130 handler->SetTechnologyEnabled( |
130 NetworkTypePattern::NonVirtual(), | 131 NetworkTypePattern::NonVirtual(), |
131 true, | 132 true, |
132 chromeos::network_handler::ErrorCallback()); | 133 chromeos::network_handler::ErrorCallback()); |
133 } | 134 } |
134 app_session_->OnLastAppWindowClosed(); | 135 app_session_->OnLastAppWindowClosed(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 app_window_handler_.reset(new AppWindowHandler(this)); | 182 app_window_handler_.reset(new AppWindowHandler(this)); |
182 app_window_handler_->Init(profile, app_id); | 183 app_window_handler_->Init(profile, app_id); |
183 | 184 |
184 browser_window_handler_.reset(new BrowserWindowHandler); | 185 browser_window_handler_.reset(new BrowserWindowHandler); |
185 | 186 |
186 plugin_handler_.reset(new KioskSessionPluginHandler(this)); | 187 plugin_handler_.reset(new KioskSessionPluginHandler(this)); |
187 | 188 |
188 // For a demo app, we don't need to either setup the update service or | 189 // For a demo app, we don't need to either setup the update service or |
189 // the idle app name notification. | 190 // the idle app name notification. |
190 if (DemoAppLauncher::IsDemoAppSession( | 191 if (DemoAppLauncher::IsDemoAppSession( |
191 user_manager::UserManager::Get()->GetActiveUser()->email())) | 192 user_manager::UserManager::Get()->GetActiveUser()->GetAccountId())) |
192 return; | 193 return; |
193 | 194 |
194 // Set the app_id for the current instance of KioskAppUpdateService. | 195 // Set the app_id for the current instance of KioskAppUpdateService. |
195 KioskAppUpdateService* update_service = | 196 KioskAppUpdateService* update_service = |
196 KioskAppUpdateServiceFactory::GetForProfile(profile); | 197 KioskAppUpdateServiceFactory::GetForProfile(profile); |
197 DCHECK(update_service); | 198 DCHECK(update_service); |
198 if (update_service) | 199 if (update_service) |
199 update_service->Init(app_id); | 200 update_service->Init(app_id); |
200 | 201 |
201 // Start to monitor external update from usb stick. | 202 // Start to monitor external update from usb stick. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 return; | 261 return; |
261 is_shutting_down_ = true; | 262 is_shutting_down_ = true; |
262 | 263 |
263 LOG(ERROR) << "Plugin hung detected. Dump and reboot."; | 264 LOG(ERROR) << "Plugin hung detected. Dump and reboot."; |
264 content::BrowserThread::PostTask( | 265 content::BrowserThread::PostTask( |
265 content::BrowserThread::IO, FROM_HERE, | 266 content::BrowserThread::IO, FROM_HERE, |
266 base::Bind(&DumpPluginProcessOnIOThread, hung_plugins)); | 267 base::Bind(&DumpPluginProcessOnIOThread, hung_plugins)); |
267 } | 268 } |
268 | 269 |
269 } // namespace chromeos | 270 } // namespace chromeos |
OLD | NEW |