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" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 *installed_file = | 105 *installed_file = |
106 installer_traits_->GetBaseDirectory() | 106 installer_traits_->GetBaseDirectory() |
107 .AppendASCII(current_version_.GetString()).AppendASCII(file); | 107 .AppendASCII(current_version_.GetString()).AppendASCII(file); |
108 return true; | 108 return true; |
109 } | 109 } |
110 | 110 |
111 void DefaultComponentInstaller::StartRegistration( | 111 void DefaultComponentInstaller::StartRegistration( |
112 ComponentUpdateService* cus) { | 112 ComponentUpdateService* cus) { |
113 base::FilePath base_dir = installer_traits_->GetBaseDirectory(); | 113 base::FilePath base_dir = installer_traits_->GetBaseDirectory(); |
114 if (!base::PathExists(base_dir) && | 114 if (!base::PathExists(base_dir) && |
115 !file_util::CreateDirectory(base_dir)) { | 115 !base::CreateDirectory(base_dir)) { |
116 NOTREACHED() << "Could not create the base directory for " | 116 NOTREACHED() << "Could not create the base directory for " |
117 << installer_traits_->GetName() << " (" | 117 << installer_traits_->GetName() << " (" |
118 << base_dir.MaybeAsASCII() << ")."; | 118 << base_dir.MaybeAsASCII() << ")."; |
119 return; | 119 return; |
120 } | 120 } |
121 | 121 |
122 base::FilePath latest_dir; | 122 base::FilePath latest_dir; |
123 base::Version latest_version(kNullVersion); | 123 base::Version latest_version(kNullVersion); |
124 std::vector<base::FilePath> older_dirs; | 124 std::vector<base::FilePath> older_dirs; |
125 bool found = false; | 125 bool found = false; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 if (current_version_.CompareTo(base::Version(kNullVersion)) > 0) { | 202 if (current_version_.CompareTo(base::Version(kNullVersion)) > 0) { |
203 scoped_ptr<base::DictionaryValue> manifest_copy( | 203 scoped_ptr<base::DictionaryValue> manifest_copy( |
204 current_manifest_->DeepCopy()); | 204 current_manifest_->DeepCopy()); |
205 installer_traits_->ComponentReady( | 205 installer_traits_->ComponentReady( |
206 current_version_, | 206 current_version_, |
207 GetInstallDirectory(), | 207 GetInstallDirectory(), |
208 manifest_copy.Pass()); | 208 manifest_copy.Pass()); |
209 } | 209 } |
210 } | 210 } |
OLD | NEW |