OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chrome_browser_main.h" | 9 #include "chrome/browser/chrome_browser_main.h" |
10 #include "chrome/browser/chrome_browser_main_extra_parts.h" | 10 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
11 #include "chrome/browser/chrome_content_browser_client.h" | 11 #include "chrome/browser/chrome_content_browser_client.h" |
12 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 12 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
13 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 13 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
14 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" | 14 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" |
15 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 15 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 16 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
16 #include "chrome/browser/chromeos/login/webui_login_display.h" | 17 #include "chrome/browser/chromeos/login/webui_login_display.h" |
17 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | |
18 #include "chrome/browser/chromeos/login/wizard_controller.h" | 18 #include "chrome/browser/chromeos/login/wizard_controller.h" |
19 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
20 #include "chrome/browser/extensions/extension_system.h" | 20 #include "chrome/browser/extensions/extension_system.h" |
21 #include "chrome/browser/google_apis/test_server/http_request.h" | 21 #include "chrome/browser/google_apis/test_server/http_request.h" |
22 #include "chrome/browser/google_apis/test_server/http_response.h" | 22 #include "chrome/browser/google_apis/test_server/http_response.h" |
23 #include "chrome/browser/google_apis/test_server/http_server.h" | 23 #include "chrome/browser/google_apis/test_server/http_server.h" |
24 #include "chrome/browser/lifetime/application_lifetime.h" | 24 #include "chrome/browser/lifetime/application_lifetime.h" |
25 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 25 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
26 #include "chrome/browser/profiles/profile_manager.h" | 26 #include "chrome/browser/profiles/profile_manager.h" |
27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 private: | 82 private: |
83 // Overridden from content::NotificationObserver: | 83 // Overridden from content::NotificationObserver: |
84 virtual void Observe(int type, | 84 virtual void Observe(int type, |
85 const content::NotificationSource& source, | 85 const content::NotificationSource& source, |
86 const content::NotificationDetails& details) OVERRIDE { | 86 const content::NotificationDetails& details) OVERRIDE { |
87 if (type == chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE) { | 87 if (type == chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE) { |
88 LOG(INFO) << "NOTIFICATION_LOGIN_WEBUI_VISIBLE"; | 88 LOG(INFO) << "NOTIFICATION_LOGIN_WEBUI_VISIBLE"; |
89 } else if (type == chrome::NOTIFICATION_KIOSK_APPS_LOADED) { | 89 } else if (type == chrome::NOTIFICATION_KIOSK_APPS_LOADED) { |
90 LOG(INFO) << "chrome::NOTIFICATION_KIOSK_APPS_LOADED"; | 90 LOG(INFO) << "chrome::NOTIFICATION_KIOSK_APPS_LOADED"; |
91 content::WebUI* web_ui = static_cast<chromeos::WebUILoginDisplayHost*>( | 91 content::WebUI* web_ui = static_cast<chromeos::LoginDisplayHostImpl*>( |
92 chromeos::WebUILoginDisplayHost::default_host())-> | 92 chromeos::LoginDisplayHostImpl::default_host())-> |
93 GetOobeUI()->web_ui(); | 93 GetOobeUI()->web_ui(); |
94 web_ui->CallJavascriptFunction("login.AppsMenuButton.runAppForTesting", | 94 web_ui->CallJavascriptFunction("login.AppsMenuButton.runAppForTesting", |
95 base::StringValue(kTestKioskApp)); | 95 base::StringValue(kTestKioskApp)); |
96 } else if (type == chrome::NOTIFICATION_KIOSK_APP_LAUNCHED) { | 96 } else if (type == chrome::NOTIFICATION_KIOSK_APP_LAUNCHED) { |
97 LOG(INFO) << "chrome::NOTIFICATION_KIOSK_APP_LAUNCHED"; | 97 LOG(INFO) << "chrome::NOTIFICATION_KIOSK_APP_LAUNCHED"; |
98 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, | 98 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
99 content::NotificationService::AllSources()); | 99 content::NotificationService::AllSources()); |
100 quit_task_.Run(); | 100 quit_task_.Run(); |
101 } else if (type == content::NOTIFICATION_RENDERER_PROCESS_CLOSED) { | 101 } else if (type == content::NOTIFICATION_RENDERER_PROCESS_CLOSED) { |
102 LOG(INFO) << "content::NOTIFICATION_RENDERER_PROCESS_CLOSED"; | 102 LOG(INFO) << "content::NOTIFICATION_RENDERER_PROCESS_CLOSED"; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // The second loop exits when kiosk app terminates and we receive | 218 // The second loop exits when kiosk app terminates and we receive |
219 // NOTIFICATION_RENDERER_PROCESS_CLOSED. | 219 // NOTIFICATION_RENDERER_PROCESS_CLOSED. |
220 scoped_refptr<content::MessageLoopRunner> runner2 = | 220 scoped_refptr<content::MessageLoopRunner> runner2 = |
221 new content::MessageLoopRunner; | 221 new content::MessageLoopRunner; |
222 content_browser_client_->browser_main_extra_parts_->set_quit_task( | 222 content_browser_client_->browser_main_extra_parts_->set_quit_task( |
223 runner2->QuitClosure()); | 223 runner2->QuitClosure()); |
224 runner2->Run(); | 224 runner2->Run(); |
225 } | 225 } |
226 | 226 |
227 } // namespace chromeos | 227 } // namespace chromeos |
OLD | NEW |