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

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

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 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 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/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 "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 24 matching lines...) Expand all
35 #if defined(OS_WIN) 35 #if defined(OS_WIN)
36 namespace { 36 namespace {
37 37
38 // This singleton allows us to attempt to calculate the Platform Parental 38 // This singleton allows us to attempt to calculate the Platform Parental
39 // Controls enabled value on a worker thread before the UI thread needs the 39 // Controls enabled value on a worker thread before the UI thread needs the
40 // value. If the UI thread finishes sooner than we expect, that's no worse than 40 // value. If the UI thread finishes sooner than we expect, that's no worse than
41 // today where we block. 41 // today where we block.
42 class PlatformParentalControlsValue { 42 class PlatformParentalControlsValue {
43 public: 43 public:
44 static PlatformParentalControlsValue* GetInstance() { 44 static PlatformParentalControlsValue* GetInstance() {
45 return Singleton<PlatformParentalControlsValue>::get(); 45 return base::Singleton<PlatformParentalControlsValue>::get();
46 } 46 }
47 47
48 bool is_enabled() const { 48 bool is_enabled() const {
49 return is_enabled_; 49 return is_enabled_;
50 } 50 }
51 51
52 private: 52 private:
53 friend struct DefaultSingletonTraits<PlatformParentalControlsValue>; 53 friend struct base::DefaultSingletonTraits<PlatformParentalControlsValue>;
54 54
55 // Histogram enum for tracking the thread that checked parental controls. 55 // Histogram enum for tracking the thread that checked parental controls.
56 enum class ThreadType { 56 enum class ThreadType {
57 UI = 0, 57 UI = 0,
58 BLOCKING, 58 BLOCKING,
59 COUNT, 59 COUNT,
60 }; 60 };
61 61
62 PlatformParentalControlsValue() 62 PlatformParentalControlsValue()
63 : is_enabled_(IsParentalControlActivityLoggingOn()) {} 63 : is_enabled_(IsParentalControlActivityLoggingOn()) {}
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() { 208 bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() {
209 #if defined(OS_WIN) 209 #if defined(OS_WIN)
210 return PlatformParentalControlsValue::GetInstance()->is_enabled(); 210 return PlatformParentalControlsValue::GetInstance()->is_enabled();
211 #elif defined(OS_ANDROID) 211 #elif defined(OS_ANDROID)
212 return chrome::android::ChromeApplication::AreParentalControlsEnabled(); 212 return chrome::android::ChromeApplication::AreParentalControlsEnabled();
213 #else 213 #else
214 return false; 214 return false;
215 #endif 215 #endif
216 } 216 }
217 217
OLDNEW
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_predictor_factory.cc ('k') | chrome/browser/prefs/pref_metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698