| 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" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/location.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/message_loop/message_loop.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 17 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 16 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_service.h" | 18 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_service.h" |
| 17 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" | 19 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" |
| 18 #include "chrome/browser/chromeos/app_mode/kiosk_session_plugin_handler.h" | 20 #include "chrome/browser/chromeos/app_mode/kiosk_session_plugin_handler.h" |
| 19 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 21 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
| 20 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 22 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 21 #include "chrome/browser/lifetime/application_lifetime.h" | 23 #include "chrome/browser/lifetime/application_lifetime.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/browser.h" | 25 #include "chrome/browser/ui/browser.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 std::string url_string = | 160 std::string url_string = |
| 159 active_tab ? active_tab->GetURL().spec() : std::string(); | 161 active_tab ? active_tab->GetURL().spec() : std::string(); |
| 160 LOG(WARNING) << "Browser opened in kiosk session" | 162 LOG(WARNING) << "Browser opened in kiosk session" |
| 161 << ", url=" << url_string; | 163 << ", url=" << url_string; |
| 162 | 164 |
| 163 browser->window()->Close(); | 165 browser->window()->Close(); |
| 164 } | 166 } |
| 165 | 167 |
| 166 // chrome::BrowserListObserver overrides: | 168 // chrome::BrowserListObserver overrides: |
| 167 void OnBrowserAdded(Browser* browser) override { | 169 void OnBrowserAdded(Browser* browser) override { |
| 168 base::MessageLoop::current()->PostTask( | 170 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 169 FROM_HERE, | 171 FROM_HERE, |
| 170 base::Bind(&BrowserWindowHandler::HandleBrowser, | 172 base::Bind(&BrowserWindowHandler::HandleBrowser, |
| 171 base::Unretained(this), // LazyInstance, always valid | 173 base::Unretained(this), // LazyInstance, always valid |
| 172 browser)); | 174 browser)); |
| 173 } | 175 } |
| 174 | 176 |
| 175 DISALLOW_COPY_AND_ASSIGN(BrowserWindowHandler); | 177 DISALLOW_COPY_AND_ASSIGN(BrowserWindowHandler); |
| 176 }; | 178 }; |
| 177 | 179 |
| 178 AppSession::AppSession() {} | 180 AppSession::AppSession() {} |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 return; | 263 return; |
| 262 is_shutting_down_ = true; | 264 is_shutting_down_ = true; |
| 263 | 265 |
| 264 LOG(ERROR) << "Plugin hung detected. Dump and reboot."; | 266 LOG(ERROR) << "Plugin hung detected. Dump and reboot."; |
| 265 content::BrowserThread::PostTask( | 267 content::BrowserThread::PostTask( |
| 266 content::BrowserThread::IO, FROM_HERE, | 268 content::BrowserThread::IO, FROM_HERE, |
| 267 base::Bind(&DumpPluginProcessOnIOThread, hung_plugins)); | 269 base::Bind(&DumpPluginProcessOnIOThread, hung_plugins)); |
| 268 } | 270 } |
| 269 | 271 |
| 270 } // namespace chromeos | 272 } // namespace chromeos |
| OLD | NEW |