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

Side by Side Diff: chrome/browser/prefs/session_startup_pref.cc

Issue 1301883002: Revert of base: Remove using:: declaration from version.h header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/prefs/session_startup_pref.h" 5 #include "chrome/browser/prefs/session_startup_pref.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // static 240 // static
241 void SessionStartupPref::MigrateMacDefaultPrefIfNecessary(PrefService* prefs) { 241 void SessionStartupPref::MigrateMacDefaultPrefIfNecessary(PrefService* prefs) {
242 #if defined(OS_MACOSX) 242 #if defined(OS_MACOSX)
243 DCHECK(prefs); 243 DCHECK(prefs);
244 if (!restore_utils::IsWindowRestoreEnabled()) 244 if (!restore_utils::IsWindowRestoreEnabled())
245 return; 245 return;
246 // The default startup pref used to be LAST, now it is DEFAULT. Don't change 246 // The default startup pref used to be LAST, now it is DEFAULT. Don't change
247 // the setting for existing profiles (even if the user has never changed it), 247 // the setting for existing profiles (even if the user has never changed it),
248 // but make new profiles default to DEFAULT. 248 // but make new profiles default to DEFAULT.
249 bool old_profile_version = 249 bool old_profile_version =
250 !prefs->FindPreference(prefs::kProfileCreatedByVersion) 250 !prefs->FindPreference(
251 ->IsDefaultValue() && 251 prefs::kProfileCreatedByVersion)->IsDefaultValue() &&
252 base::Version(prefs->GetString(prefs::kProfileCreatedByVersion)) 252 Version(prefs->GetString(prefs::kProfileCreatedByVersion)).IsOlderThan(
253 .IsOlderThan("21.0.1180.0"); 253 "21.0.1180.0");
254 if (old_profile_version && TypeIsDefault(prefs)) 254 if (old_profile_version && TypeIsDefault(prefs))
255 prefs->SetInteger(prefs::kRestoreOnStartup, kPrefValueLast); 255 prefs->SetInteger(prefs::kRestoreOnStartup, kPrefValueLast);
256 #endif 256 #endif
257 } 257 }
258 258
259 // static 259 // static
260 bool SessionStartupPref::TypeIsManaged(PrefService* prefs) { 260 bool SessionStartupPref::TypeIsManaged(PrefService* prefs) {
261 DCHECK(prefs); 261 DCHECK(prefs);
262 const PrefService::Preference* pref_restore = 262 const PrefService::Preference* pref_restore =
263 prefs->FindPreference(prefs::kRestoreOnStartup); 263 prefs->FindPreference(prefs::kRestoreOnStartup);
(...skipping 25 matching lines...) Expand all
289 case kPrefValueLast: return SessionStartupPref::LAST; 289 case kPrefValueLast: return SessionStartupPref::LAST;
290 case kPrefValueURLs: return SessionStartupPref::URLS; 290 case kPrefValueURLs: return SessionStartupPref::URLS;
291 case kPrefValueHomePage: return SessionStartupPref::HOMEPAGE; 291 case kPrefValueHomePage: return SessionStartupPref::HOMEPAGE;
292 default: return SessionStartupPref::DEFAULT; 292 default: return SessionStartupPref::DEFAULT;
293 } 293 }
294 } 294 }
295 295
296 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} 296 SessionStartupPref::SessionStartupPref(Type type) : type(type) {}
297 297
298 SessionStartupPref::~SessionStartupPref() {} 298 SessionStartupPref::~SessionStartupPref() {}
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_metadata_unittest.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698