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

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

Issue 2382023003: Optimize ShouldLaunchIncognito() since its on the startup path. (Closed)
Patch Set: Address gab's comments. Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/prefs/incognito_mode_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ 5 #ifndef CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_
6 #define CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ 6 #define CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 static void InitializePlatformParentalControls(); 71 static void InitializePlatformParentalControls();
72 #endif 72 #endif
73 73
74 // Returns whether parental controls have been enabled on the platform. This 74 // Returns whether parental controls have been enabled on the platform. This
75 // method evaluates and caches if the platform controls have been enabled on 75 // method evaluates and caches if the platform controls have been enabled on
76 // the first call, which must be on the UI thread when IO and blocking are 76 // the first call, which must be on the UI thread when IO and blocking are
77 // allowed. Subsequent calls may be from any thread. 77 // allowed. Subsequent calls may be from any thread.
78 static bool ArePlatformParentalControlsEnabled() WARN_UNUSED_RESULT; 78 static bool ArePlatformParentalControlsEnabled() WARN_UNUSED_RESULT;
79 79
80 private: 80 private:
81 // Specifies whether parental controls should be checked. See comment below.
82 enum GetAvailabilityMode {
83 CHECK_PARENTAL_CONTROLS,
84 DONT_CHECK_PARENTAL_CONTROLS,
85 };
86
87 // Internal version of GetAvailability() that specifies whether parental
88 // controls should be checked (which is expensive and not always necessary
89 // to do - such as when checking for FORCED state).
90 static Availability GetAvailabilityInternal(const PrefService* pref_service,
91 GetAvailabilityMode mode);
92
81 DISALLOW_IMPLICIT_CONSTRUCTORS(IncognitoModePrefs); 93 DISALLOW_IMPLICIT_CONSTRUCTORS(IncognitoModePrefs);
82 }; 94 };
83 95
84 #endif // CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_ 96 #endif // CHROME_BROWSER_PREFS_INCOGNITO_MODE_PREFS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefs/incognito_mode_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698