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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 } else { | 115 } else { |
116 latest_dir = path; | 116 latest_dir = path; |
117 latest_version = version; | 117 latest_version = version; |
118 found = true; | 118 found = true; |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 if (found) { | 122 if (found) { |
123 current_version_ = latest_version; | 123 current_version_ = latest_version; |
124 file_util::ReadFileToString(latest_dir.AppendASCII("manifest.fingerprint"), | 124 base::ReadFileToString(latest_dir.AppendASCII("manifest.fingerprint"), |
125 ¤t_fingerprint_); | 125 ¤t_fingerprint_); |
126 } | 126 } |
127 | 127 |
128 // Remove older versions of the component. None should be in use during | 128 // Remove older versions of the component. None should be in use during |
129 // browser startup. | 129 // browser startup. |
130 for (std::vector<base::FilePath>::iterator iter = older_dirs.begin(); | 130 for (std::vector<base::FilePath>::iterator iter = older_dirs.begin(); |
131 iter != older_dirs.end(); ++iter) { | 131 iter != older_dirs.end(); ++iter) { |
132 base::DeleteFile(*iter, true); | 132 base::DeleteFile(*iter, true); |
133 } | 133 } |
134 | 134 |
135 content::BrowserThread::PostTask( | 135 content::BrowserThread::PostTask( |
(...skipping 28 matching lines...) Expand all Loading... |
164 base::Version installed_version; | 164 base::Version installed_version; |
165 if (current_version_.CompareTo(base::Version(kNullVersion)) <= 0) { | 165 if (current_version_.CompareTo(base::Version(kNullVersion)) <= 0) { |
166 content::BrowserThread::PostTask( | 166 content::BrowserThread::PostTask( |
167 content::BrowserThread::FILE, FROM_HERE, | 167 content::BrowserThread::FILE, FROM_HERE, |
168 base::Bind(&ComponentInstallerTraits::ComponentReady, | 168 base::Bind(&ComponentInstallerTraits::ComponentReady, |
169 base::Unretained(installer_traits_.get()), | 169 base::Unretained(installer_traits_.get()), |
170 installed_version, | 170 installed_version, |
171 GetInstallDirectory())); | 171 GetInstallDirectory())); |
172 } | 172 } |
173 } | 173 } |
OLD | NEW |