| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/component_updater/recovery_component_installer.h" | 5 #include "chrome/browser/component_updater/recovery_component_installer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 // ComponentInstaller implementation: | 180 // ComponentInstaller implementation: |
| 181 void OnUpdateError(int error) override; | 181 void OnUpdateError(int error) override; |
| 182 | 182 |
| 183 bool Install(const base::DictionaryValue& manifest, | 183 bool Install(const base::DictionaryValue& manifest, |
| 184 const base::FilePath& unpack_path) override; | 184 const base::FilePath& unpack_path) override; |
| 185 | 185 |
| 186 bool GetInstalledFile(const std::string& file, | 186 bool GetInstalledFile(const std::string& file, |
| 187 base::FilePath* installed_file) override; | 187 base::FilePath* installed_file) override; |
| 188 | 188 |
| 189 bool Uninstall() override; |
| 190 |
| 189 private: | 191 private: |
| 190 ~RecoveryComponentInstaller() override {} | 192 ~RecoveryComponentInstaller() override {} |
| 191 | 193 |
| 192 bool RunInstallCommand(const base::CommandLine& cmdline, | 194 bool RunInstallCommand(const base::CommandLine& cmdline, |
| 193 const base::FilePath& installer_folder) const; | 195 const base::FilePath& installer_folder) const; |
| 194 | 196 |
| 195 Version current_version_; | 197 Version current_version_; |
| 196 PrefService* prefs_; | 198 PrefService* prefs_; |
| 197 }; | 199 }; |
| 198 | 200 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } | 355 } |
| 354 return true; | 356 return true; |
| 355 } | 357 } |
| 356 | 358 |
| 357 bool RecoveryComponentInstaller::GetInstalledFile( | 359 bool RecoveryComponentInstaller::GetInstalledFile( |
| 358 const std::string& file, | 360 const std::string& file, |
| 359 base::FilePath* installed_file) { | 361 base::FilePath* installed_file) { |
| 360 return false; | 362 return false; |
| 361 } | 363 } |
| 362 | 364 |
| 365 bool RecoveryComponentInstaller::Uninstall() { |
| 366 return false; |
| 367 } |
| 368 |
| 363 void RegisterRecoveryComponent(ComponentUpdateService* cus, | 369 void RegisterRecoveryComponent(ComponentUpdateService* cus, |
| 364 PrefService* prefs) { | 370 PrefService* prefs) { |
| 365 #if !defined(OS_CHROMEOS) | 371 #if !defined(OS_CHROMEOS) |
| 366 if (SimulatingElevatedRecovery()) { | 372 if (SimulatingElevatedRecovery()) { |
| 367 BrowserThread::PostTask( | 373 BrowserThread::PostTask( |
| 368 BrowserThread::UI, | 374 BrowserThread::UI, |
| 369 FROM_HERE, | 375 FROM_HERE, |
| 370 base::Bind(&SimulateElevatedRecoveryHelper, prefs)); | 376 base::Bind(&SimulateElevatedRecoveryHelper, prefs)); |
| 371 } | 377 } |
| 372 | 378 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 396 #endif // OS_WIN | 402 #endif // OS_WIN |
| 397 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); | 403 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); |
| 398 } | 404 } |
| 399 | 405 |
| 400 void DeclinedElevatedRecoveryInstall(PrefService* prefs) { | 406 void DeclinedElevatedRecoveryInstall(PrefService* prefs) { |
| 401 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 407 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 402 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); | 408 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); |
| 403 } | 409 } |
| 404 | 410 |
| 405 } // namespace component_updater | 411 } // namespace component_updater |
| OLD | NEW |