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

Unified Diff: chrome/browser/prefs/incognito_mode_prefs.h

Issue 2382023003: Optimize ShouldLaunchIncognito() since its on the startup path. (Closed)
Patch Set: Address comments. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prefs/incognito_mode_prefs.h
diff --git a/chrome/browser/prefs/incognito_mode_prefs.h b/chrome/browser/prefs/incognito_mode_prefs.h
index cbf30efa6abab726cdf420f57516228d7e370bda..2d02e089ec2d0f32518950916fca938c20907416 100644
--- a/chrome/browser/prefs/incognito_mode_prefs.h
+++ b/chrome/browser/prefs/incognito_mode_prefs.h
@@ -78,6 +78,18 @@ class IncognitoModePrefs {
static bool ArePlatformParentalControlsEnabled() WARN_UNUSED_RESULT;
private:
+ // Specifies whether parental controls should be checked. See comment below.
+ enum GetAvailabilityMode {
gab 2016/10/03 17:08:12 enum class
Alexei Svitkine (slow) 2016/10/03 18:57:39 This requires prefixing all uses of the constants
gab 2016/10/03 19:05:57 IMO that means that GetAvailabilityMode is too gen
Alexei Svitkine (slow) 2016/10/03 19:25:36 At first I really like this suggestion, but then I
+ CHECK_PARENTAL_CONTROLS,
+ DONT_CHECK_PARENTAL_CONTROLS,
+ };
+
+ // Internal version of GetAvailability() that specifies whether parental
+ // controls should be checked (which is expensive and not always necessary
+ // to do - such as when checking for FORCED state).
+ static Availability GetAvailabilityInternal(const PrefService* pref_service,
+ GetAvailabilityMode mode);
+
DISALLOW_IMPLICIT_CONSTRUCTORS(IncognitoModePrefs);
};
« no previous file with comments | « no previous file | chrome/browser/prefs/incognito_mode_prefs.cc » ('j') | chrome/browser/prefs/incognito_mode_prefs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698