| 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/app_mode/kiosk_app_manager.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool loaded() const { return loaded_; } | 125 bool loaded() const { return loaded_; } |
| 126 | 126 |
| 127 private: | 127 private: |
| 128 // KioskAppManagerObserver overrides: | 128 // KioskAppManagerObserver overrides: |
| 129 virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE { | 129 virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE { |
| 130 ++data_change_count_; | 130 ++data_change_count_; |
| 131 if (data_change_count_ < data_loaded_threshold_) | 131 if (data_change_count_ < data_loaded_threshold_) |
| 132 return; | 132 return; |
| 133 loaded_ = true; | 133 loaded_ = true; |
| 134 quit_ = true; | 134 quit_ = true; |
| 135 if (runner_) | 135 if (runner_.get()) |
| 136 runner_->Quit(); | 136 runner_->Quit(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE { | 139 virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE { |
| 140 loaded_ = false; | 140 loaded_ = false; |
| 141 quit_ = true; | 141 quit_ = true; |
| 142 if (runner_) | 142 if (runner_.get()) |
| 143 runner_->Quit(); | 143 runner_->Quit(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 virtual void OnKioskExtensionLoadedInCache( | 146 virtual void OnKioskExtensionLoadedInCache( |
| 147 const std::string& app_id) OVERRIDE { | 147 const std::string& app_id) OVERRIDE { |
| 148 OnKioskAppDataChanged(app_id); | 148 OnKioskAppDataChanged(app_id); |
| 149 } | 149 } |
| 150 | 150 |
| 151 virtual void OnKioskExtensionDownloadFailed( | 151 virtual void OnKioskExtensionDownloadFailed( |
| 152 const std::string& app_id) OVERRIDE { | 152 const std::string& app_id) OVERRIDE { |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 manager()->GetConsumerKioskAutoLaunchStatus( | 683 manager()->GetConsumerKioskAutoLaunchStatus( |
| 684 base::Bind(&ConsumerKioskAutoLaunchStatusCheck, | 684 base::Bind(&ConsumerKioskAutoLaunchStatusCheck, |
| 685 status.get(), | 685 status.get(), |
| 686 runner3->QuitClosure())); | 686 runner3->QuitClosure())); |
| 687 runner3->Run(); | 687 runner3->Run(); |
| 688 EXPECT_EQ(*status.get(), | 688 EXPECT_EQ(*status.get(), |
| 689 KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_DISABLED); | 689 KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_DISABLED); |
| 690 } | 690 } |
| 691 | 691 |
| 692 } // namespace chromeos | 692 } // namespace chromeos |
| OLD | NEW |