| 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" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (!window_registry_->GetAppWindowsForApp(app_id).empty()) { | 69 if (!window_registry_->GetAppWindowsForApp(app_id).empty()) { |
| 70 base::MessageLoop::current()->PostTask( | 70 base::MessageLoop::current()->PostTask( |
| 71 FROM_HERE, | 71 FROM_HERE, |
| 72 base::Bind(&AppWindowWatcher::NotifyAppWindowCreated, | 72 base::Bind(&AppWindowWatcher::NotifyAppWindowCreated, |
| 73 weak_factory_.GetWeakPtr())); | 73 weak_factory_.GetWeakPtr())); |
| 74 return; | 74 return; |
| 75 } else { | 75 } else { |
| 76 window_registry_->AddObserver(this); | 76 window_registry_->AddObserver(this); |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 virtual ~AppWindowWatcher() { | 79 ~AppWindowWatcher() override { window_registry_->RemoveObserver(this); } |
| 80 window_registry_->RemoveObserver(this); | |
| 81 } | |
| 82 | 80 |
| 83 private: | 81 private: |
| 84 // extensions::AppWindowRegistry::Observer overrides: | 82 // extensions::AppWindowRegistry::Observer overrides: |
| 85 virtual void OnAppWindowAdded(extensions::AppWindow* app_window) override { | 83 void OnAppWindowAdded(extensions::AppWindow* app_window) override { |
| 86 if (app_window->extension_id() == app_id_) { | 84 if (app_window->extension_id() == app_id_) { |
| 87 window_registry_->RemoveObserver(this); | 85 window_registry_->RemoveObserver(this); |
| 88 NotifyAppWindowCreated(); | 86 NotifyAppWindowCreated(); |
| 89 } | 87 } |
| 90 } | 88 } |
| 91 | 89 |
| 92 void NotifyAppWindowCreated() { | 90 void NotifyAppWindowCreated() { |
| 93 controller_->OnAppWindowCreated(); | 91 controller_->OnAppWindowCreated(); |
| 94 } | 92 } |
| 95 | 93 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 KioskAppLaunchError::Save(error); | 418 KioskAppLaunchError::Save(error); |
| 421 chrome::AttemptUserExit(); | 419 chrome::AttemptUserExit(); |
| 422 CleanUp(); | 420 CleanUp(); |
| 423 } | 421 } |
| 424 | 422 |
| 425 bool AppLaunchController::IsShowingNetworkConfigScreen() { | 423 bool AppLaunchController::IsShowingNetworkConfigScreen() { |
| 426 return network_config_requested_; | 424 return network_config_requested_; |
| 427 } | 425 } |
| 428 | 426 |
| 429 } // namespace chromeos | 427 } // namespace chromeos |
| OLD | NEW |