Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: chrome/browser/extensions/chrome_extensions_browser_client.cc

Issue 1575523002: Comparison and streaming operators for base::Version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes mistake in previous patch set. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/extensions/chrome_extensions_browser_client.h" 5 #include "chrome/browser/extensions/chrome_extensions_browser_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return false; 206 return false;
207 207
208 PrefService* pref_service = extension_prefs->pref_service(); 208 PrefService* pref_service = extension_prefs->pref_service();
209 base::Version last_version; 209 base::Version last_version;
210 if (pref_service->HasPrefPath(pref_names::kLastChromeVersion)) { 210 if (pref_service->HasPrefPath(pref_names::kLastChromeVersion)) {
211 std::string last_version_str = 211 std::string last_version_str =
212 pref_service->GetString(pref_names::kLastChromeVersion); 212 pref_service->GetString(pref_names::kLastChromeVersion);
213 last_version = base::Version(last_version_str); 213 last_version = base::Version(last_version_str);
214 } 214 }
215 215
216 std::string current_version = version_info::GetVersionNumber(); 216 std::string current_version_str = version_info::GetVersionNumber();
217 pref_service->SetString(pref_names::kLastChromeVersion, 217 base::Version current_version(current_version_str);
218 current_version); 218 pref_service->SetString(pref_names::kLastChromeVersion, current_version_str);
219 219
220 // If there was no version string in prefs, assume we're out of date. 220 // If there was no version string in prefs, assume we're out of date.
221 if (!last_version.IsValid()) 221 if (!last_version.IsValid())
222 return true; 222 return true;
223 // If the current version string is invalid, assume we didn't update.
224 if (!current_version.IsValid())
225 return false;
223 226
224 return last_version.IsOlderThan(current_version); 227 return last_version < current_version;
225 } 228 }
226 229
227 void ChromeExtensionsBrowserClient::PermitExternalProtocolHandler() { 230 void ChromeExtensionsBrowserClient::PermitExternalProtocolHandler() {
228 ExternalProtocolHandler::PermitLaunchUrl(); 231 ExternalProtocolHandler::PermitLaunchUrl();
229 } 232 }
230 233
231 bool ChromeExtensionsBrowserClient::IsRunningInForcedAppMode() { 234 bool ChromeExtensionsBrowserClient::IsRunningInForcedAppMode() {
232 return chrome::IsRunningInForcedAppMode(); 235 return chrome::IsRunningInForcedAppMode();
233 } 236 }
234 237
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 391 }
389 392
390 scoped_refptr<update_client::UpdateClient> 393 scoped_refptr<update_client::UpdateClient>
391 ChromeExtensionsBrowserClient::CreateUpdateClient( 394 ChromeExtensionsBrowserClient::CreateUpdateClient(
392 content::BrowserContext* context) { 395 content::BrowserContext* context) {
393 return update_client::UpdateClientFactory( 396 return update_client::UpdateClientFactory(
394 make_scoped_refptr(new ChromeUpdateClientConfig(context))); 397 make_scoped_refptr(new ChromeUpdateClientConfig(context)));
395 } 398 }
396 399
397 } // namespace extensions 400 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/pnacl_component_installer.cc ('k') | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698