| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/caps_installer_win.h" | 5 #include "chrome/browser/component_updater/caps_installer_win.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 14 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 18 #include "base/process/launch.h" | 19 #include "base/process/launch.h" |
| 19 #include "base/threading/worker_pool.h" | 20 #include "base/threading/worker_pool.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 72 |
| 72 bool VerifyInstallation(const base::DictionaryValue& manifest, | 73 bool VerifyInstallation(const base::DictionaryValue& manifest, |
| 73 const base::FilePath& dir) const override { | 74 const base::FilePath& dir) const override { |
| 74 bool has_binary = base::PathExists(dir.Append(kCapsBinary)); | 75 bool has_binary = base::PathExists(dir.Append(kCapsBinary)); |
| 75 ReportUmaStep(has_binary ? CAPS_COMPONENT_READY : CAPS_COMPONENT_MISSING); | 76 ReportUmaStep(has_binary ? CAPS_COMPONENT_READY : CAPS_COMPONENT_MISSING); |
| 76 return has_binary; | 77 return has_binary; |
| 77 } | 78 } |
| 78 | 79 |
| 79 bool CanAutoUpdate() const override { return true; } | 80 bool CanAutoUpdate() const override { return true; } |
| 80 | 81 |
| 82 bool RequiresNetworkEncryption() const override { return false; } |
| 83 |
| 81 bool OnCustomInstall(const base::DictionaryValue& manifest, | 84 bool OnCustomInstall(const base::DictionaryValue& manifest, |
| 82 const base::FilePath& install_dir) override { | 85 const base::FilePath& install_dir) override { |
| 83 return true; | 86 return true; |
| 84 } | 87 } |
| 85 | 88 |
| 86 void ComponentReady(const base::Version& version, | 89 void ComponentReady(const base::Version& version, |
| 87 const base::FilePath& install_dir, | 90 const base::FilePath& install_dir, |
| 88 scoped_ptr<base::DictionaryValue> manifest) override { | 91 scoped_ptr<base::DictionaryValue> manifest) override { |
| 89 // Can't block here. This is usually the browser UI thread. | 92 // Can't block here. This is usually the browser UI thread. |
| 90 base::WorkerPool::PostTask( | 93 base::WorkerPool::PostTask( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 114 void RegisterCAPSComponent(ComponentUpdateService* cus) { | 117 void RegisterCAPSComponent(ComponentUpdateService* cus) { |
| 115 // The component updater takes ownership of |installer|. | 118 // The component updater takes ownership of |installer|. |
| 116 scoped_ptr<ComponentInstallerTraits> traits( | 119 scoped_ptr<ComponentInstallerTraits> traits( |
| 117 new CAPSInstallerTraits()); | 120 new CAPSInstallerTraits()); |
| 118 DefaultComponentInstaller* installer = | 121 DefaultComponentInstaller* installer = |
| 119 new DefaultComponentInstaller(std::move(traits)); | 122 new DefaultComponentInstaller(std::move(traits)); |
| 120 installer->Register(cus, base::Closure()); | 123 installer->Register(cus, base::Closure()); |
| 121 } | 124 } |
| 122 | 125 |
| 123 } // namespace component_updater | 126 } // namespace component_updater |
| OLD | NEW |