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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 crx.fingerprint = current_fingerprint_; | 154 crx.fingerprint = current_fingerprint_; |
155 installer_traits_->GetHash(&crx.pk_hash); | 155 installer_traits_->GetHash(&crx.pk_hash); |
156 ComponentUpdateService::Status status = cus->RegisterComponent(crx); | 156 ComponentUpdateService::Status status = cus->RegisterComponent(crx); |
157 if (status != ComponentUpdateService::kOk && | 157 if (status != ComponentUpdateService::kOk && |
158 status != ComponentUpdateService::kReplaced) { | 158 status != ComponentUpdateService::kReplaced) { |
159 NOTREACHED() << "Component registration failed for " | 159 NOTREACHED() << "Component registration failed for " |
160 << installer_traits_->GetName(); | 160 << installer_traits_->GetName(); |
161 return; | 161 return; |
162 } | 162 } |
163 | 163 |
164 base::Version installed_version; | 164 if (current_version_.CompareTo(base::Version(kNullVersion)) > 0) { |
165 if (current_version_.CompareTo(base::Version(kNullVersion)) <= 0) { | |
166 content::BrowserThread::PostTask( | 165 content::BrowserThread::PostTask( |
167 content::BrowserThread::FILE, FROM_HERE, | 166 content::BrowserThread::FILE, FROM_HERE, |
168 base::Bind(&ComponentInstallerTraits::ComponentReady, | 167 base::Bind(&ComponentInstallerTraits::ComponentReady, |
169 base::Unretained(installer_traits_.get()), | 168 base::Unretained(installer_traits_.get()), |
170 installed_version, | 169 current_version_, |
171 GetInstallDirectory())); | 170 GetInstallDirectory())); |
172 } | 171 } |
173 } | 172 } |
OLD | NEW |