| 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/login/app_launch_controller.h" | 5 #include "chrome/browser/chromeos/login/app_launch_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| 11 #include "base/location.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "base/message_loop/message_loop.h" | |
| 15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
| 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 17 #include "base/values.h" | 19 #include "base/values.h" |
| 18 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/chrome_notification_types.h" | 21 #include "chrome/browser/chrome_notification_types.h" |
| 20 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 22 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 21 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" | 23 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" |
| 22 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 24 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 23 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 25 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 24 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 26 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 25 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 27 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 : public extensions::AppWindowRegistry::Observer { | 92 : public extensions::AppWindowRegistry::Observer { |
| 91 public: | 93 public: |
| 92 explicit AppWindowWatcher(AppLaunchController* controller, | 94 explicit AppWindowWatcher(AppLaunchController* controller, |
| 93 const std::string& app_id) | 95 const std::string& app_id) |
| 94 : controller_(controller), | 96 : controller_(controller), |
| 95 app_id_(app_id), | 97 app_id_(app_id), |
| 96 window_registry_( | 98 window_registry_( |
| 97 extensions::AppWindowRegistry::Get(controller->profile_)), | 99 extensions::AppWindowRegistry::Get(controller->profile_)), |
| 98 weak_factory_(this) { | 100 weak_factory_(this) { |
| 99 if (!window_registry_->GetAppWindowsForApp(app_id).empty()) { | 101 if (!window_registry_->GetAppWindowsForApp(app_id).empty()) { |
| 100 base::MessageLoop::current()->PostTask( | 102 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 101 FROM_HERE, | 103 FROM_HERE, base::Bind(&AppWindowWatcher::NotifyAppWindowCreated, |
| 102 base::Bind(&AppWindowWatcher::NotifyAppWindowCreated, | 104 weak_factory_.GetWeakPtr())); |
| 103 weak_factory_.GetWeakPtr())); | |
| 104 return; | 105 return; |
| 105 } else { | 106 } else { |
| 106 window_registry_->AddObserver(this); | 107 window_registry_->AddObserver(this); |
| 107 } | 108 } |
| 108 } | 109 } |
| 109 ~AppWindowWatcher() override { window_registry_->RemoveObserver(this); } | 110 ~AppWindowWatcher() override { window_registry_->RemoveObserver(this); } |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 // extensions::AppWindowRegistry::Observer overrides: | 113 // extensions::AppWindowRegistry::Observer overrides: |
| 113 void OnAppWindowAdded(extensions::AppWindow* app_window) override { | 114 void OnAppWindowAdded(extensions::AppWindow* app_window) override { |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 KioskAppLaunchError::Save(error); | 464 KioskAppLaunchError::Save(error); |
| 464 chrome::AttemptUserExit(); | 465 chrome::AttemptUserExit(); |
| 465 CleanUp(); | 466 CleanUp(); |
| 466 } | 467 } |
| 467 | 468 |
| 468 bool AppLaunchController::IsShowingNetworkConfigScreen() { | 469 bool AppLaunchController::IsShowingNetworkConfigScreen() { |
| 469 return network_config_requested_; | 470 return network_config_requested_; |
| 470 } | 471 } |
| 471 | 472 |
| 472 } // namespace chromeos | 473 } // namespace chromeos |
| OLD | NEW |