| 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/startup_app_launcher.h" | 5 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // is ready for sure. | 112 // is ready for sure. |
| 113 wait_for_crx_update_ = true; | 113 wait_for_crx_update_ = true; |
| 114 KioskAppManager::Get()->UpdateExternalCache(); | 114 KioskAppManager::Get()->UpdateExternalCache(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void StartupAppLauncher::StartLoadingOAuthFile() { | 117 void StartupAppLauncher::StartLoadingOAuthFile() { |
| 118 delegate_->OnLoadingOAuthFile(); | 118 delegate_->OnLoadingOAuthFile(); |
| 119 | 119 |
| 120 KioskOAuthParams* auth_params = new KioskOAuthParams(); | 120 KioskOAuthParams* auth_params = new KioskOAuthParams(); |
| 121 base::PostTaskWithTraitsAndReply( | 121 base::PostTaskWithTraitsAndReply( |
| 122 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 122 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
| 123 base::TaskPriority::BACKGROUND), | |
| 124 base::Bind(&StartupAppLauncher::LoadOAuthFileAsync, auth_params), | 123 base::Bind(&StartupAppLauncher::LoadOAuthFileAsync, auth_params), |
| 125 base::Bind(&StartupAppLauncher::OnOAuthFileLoaded, AsWeakPtr(), | 124 base::Bind(&StartupAppLauncher::OnOAuthFileLoaded, AsWeakPtr(), |
| 126 base::Owned(auth_params))); | 125 base::Owned(auth_params))); |
| 127 } | 126 } |
| 128 | 127 |
| 129 // static. | 128 // static. |
| 130 void StartupAppLauncher::LoadOAuthFileAsync(KioskOAuthParams* auth_params) { | 129 void StartupAppLauncher::LoadOAuthFileAsync(KioskOAuthParams* auth_params) { |
| 131 int error_code = JSONFileValueDeserializer::JSON_NO_ERROR; | 130 int error_code = JSONFileValueDeserializer::JSON_NO_ERROR; |
| 132 std::string error_msg; | 131 std::string error_msg; |
| 133 base::FilePath user_data_dir; | 132 base::FilePath user_data_dir; |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 // Skip copying meta data from the current installed primary app when | 590 // Skip copying meta data from the current installed primary app when |
| 592 // there is a pending update. | 591 // there is a pending update. |
| 593 if (PrimaryAppHasPendingUpdate()) | 592 if (PrimaryAppHasPendingUpdate()) |
| 594 return; | 593 return; |
| 595 | 594 |
| 596 KioskAppManager::Get()->ClearAppData(app_id_); | 595 KioskAppManager::Get()->ClearAppData(app_id_); |
| 597 KioskAppManager::Get()->UpdateAppDataFromProfile(app_id_, profile_, NULL); | 596 KioskAppManager::Get()->UpdateAppDataFromProfile(app_id_, profile_, NULL); |
| 598 } | 597 } |
| 599 | 598 |
| 600 } // namespace chromeos | 599 } // namespace chromeos |
| OLD | NEW |