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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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 | Annotate | Revision Log
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/incognito_mode_prefs.h" 5 #include "chrome/browser/prefs/incognito_mode_prefs.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 return result; 45 return result;
46 } 46 }
47 47
48 // static 48 // static
49 void IncognitoModePrefs::SetAvailability(PrefService* prefs, 49 void IncognitoModePrefs::SetAvailability(PrefService* prefs,
50 const Availability availability) { 50 const Availability availability) {
51 prefs->SetInteger(prefs::kIncognitoModeAvailability, availability); 51 prefs->SetInteger(prefs::kIncognitoModeAvailability, availability);
52 } 52 }
53 53
54 // static 54 // static
55 void IncognitoModePrefs::RegisterUserPrefs(PrefService* pref_service) { 55 void IncognitoModePrefs::RegisterUserPrefs(PrefServiceSyncable* pref_service) {
56 DCHECK(pref_service); 56 DCHECK(pref_service);
57 pref_service->RegisterIntegerPref(prefs::kIncognitoModeAvailability, 57 pref_service->RegisterIntegerPref(prefs::kIncognitoModeAvailability,
58 IncognitoModePrefs::ENABLED, 58 IncognitoModePrefs::ENABLED,
59 PrefService::UNSYNCABLE_PREF); 59 PrefServiceSyncable::UNSYNCABLE_PREF);
60 } 60 }
61 61
62 // static 62 // static
63 bool IncognitoModePrefs::ShouldLaunchIncognito( 63 bool IncognitoModePrefs::ShouldLaunchIncognito(
64 const CommandLine& command_line, 64 const CommandLine& command_line,
65 const PrefService* prefs) { 65 const PrefService* prefs) {
66 Availability incognito_avail = GetAvailability(prefs); 66 Availability incognito_avail = GetAvailability(prefs);
67 return incognito_avail != IncognitoModePrefs::DISABLED && 67 return incognito_avail != IncognitoModePrefs::DISABLED &&
68 (command_line.HasSwitch(switches::kIncognito) || 68 (command_line.HasSwitch(switches::kIncognito) ||
69 incognito_avail == IncognitoModePrefs::FORCED); 69 incognito_avail == IncognitoModePrefs::FORCED);
70 } 70 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/incognito_mode_prefs.h ('k') | chrome/browser/prefs/incognito_mode_prefs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698