| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| 11 // TODO(ddorwin): Find a better place for ReadManifest. | 11 // TODO(ddorwin): Find a better place for ReadManifest. |
| 12 #include "chrome/browser/component_updater/component_unpacker.h" | 12 #include "chrome/browser/component_updater/component_unpacker.h" |
| 13 #include "chrome/browser/component_updater/default_component_installer.h" | 13 #include "chrome/browser/component_updater/default_component_installer.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 | 15 |
| 16 namespace component_updater { |
| 17 |
| 16 namespace { | 18 namespace { |
| 17 // Version "0" corresponds to no installed version. By the server's conventions, | 19 // Version "0" corresponds to no installed version. By the server's conventions, |
| 18 // we represent it as a dotted quad. | 20 // we represent it as a dotted quad. |
| 19 const char kNullVersion[] = "0.0.0.0"; | 21 const char kNullVersion[] = "0.0.0.0"; |
| 20 } // namespace | 22 } // namespace |
| 21 | 23 |
| 22 ComponentInstallerTraits::~ComponentInstallerTraits() { | 24 ComponentInstallerTraits::~ComponentInstallerTraits() { |
| 23 } | 25 } |
| 24 | 26 |
| 25 DefaultComponentInstaller::DefaultComponentInstaller( | 27 DefaultComponentInstaller::DefaultComponentInstaller( |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 203 |
| 202 if (current_version_.CompareTo(base::Version(kNullVersion)) > 0) { | 204 if (current_version_.CompareTo(base::Version(kNullVersion)) > 0) { |
| 203 scoped_ptr<base::DictionaryValue> manifest_copy( | 205 scoped_ptr<base::DictionaryValue> manifest_copy( |
| 204 current_manifest_->DeepCopy()); | 206 current_manifest_->DeepCopy()); |
| 205 installer_traits_->ComponentReady( | 207 installer_traits_->ComponentReady( |
| 206 current_version_, | 208 current_version_, |
| 207 GetInstallDirectory(), | 209 GetInstallDirectory(), |
| 208 manifest_copy.Pass()); | 210 manifest_copy.Pass()); |
| 209 } | 211 } |
| 210 } | 212 } |
| 213 |
| 214 } // namespace component_updater |
| 215 |
| OLD | NEW |