| OLD | NEW |
| 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" |
| 11 #include "base/threading/thread_restrictions.h" | 11 #include "base/threading/thread_restrictions.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/common/features.h" |
| 15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 16 #include "components/pref_registry/pref_registry_syncable.h" | 17 #include "components/pref_registry/pref_registry_syncable.h" |
| 17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 18 | 19 |
| 19 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
| 20 #include <windows.h> | 21 #include <windows.h> |
| 21 #include <wpcapi.h> | 22 #include <wpcapi.h> |
| 22 #include "base/bind.h" | 23 #include "base/bind.h" |
| 23 #include "base/bind_helpers.h" | 24 #include "base/bind_helpers.h" |
| 24 #include "base/memory/singleton.h" | 25 #include "base/memory/singleton.h" |
| 25 #include "base/win/scoped_comptr.h" | 26 #include "base/win/scoped_comptr.h" |
| 26 #include "base/win/windows_version.h" | 27 #include "base/win/windows_version.h" |
| 27 #endif // OS_WIN | 28 #endif // OS_WIN |
| 28 | 29 |
| 29 #if defined(OS_ANDROID) | 30 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 30 #include "chrome/browser/android/chrome_application.h" | 31 #include "chrome/browser/android/chrome_application.h" |
| 31 #endif // OS_ANDROID | 32 #endif // BUILDFLAG(ANDROID_JAVA_UI) |
| 32 | 33 |
| 33 using content::BrowserThread; | 34 using content::BrowserThread; |
| 34 | 35 |
| 35 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
| 36 namespace { | 37 namespace { |
| 37 | 38 |
| 38 // This singleton allows us to attempt to calculate the Platform Parental | 39 // 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 | 40 // 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 | 41 // value. If the UI thread finishes sooner than we expect, that's no worse than |
| 41 // today where we block. | 42 // today where we block. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 FROM_HERE, | 202 FROM_HERE, |
| 202 base::Bind( | 203 base::Bind( |
| 203 base::IgnoreResult(&PlatformParentalControlsValue::GetInstance))); | 204 base::IgnoreResult(&PlatformParentalControlsValue::GetInstance))); |
| 204 } | 205 } |
| 205 #endif | 206 #endif |
| 206 | 207 |
| 207 // static | 208 // static |
| 208 bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() { | 209 bool IncognitoModePrefs::ArePlatformParentalControlsEnabled() { |
| 209 #if defined(OS_WIN) | 210 #if defined(OS_WIN) |
| 210 return PlatformParentalControlsValue::GetInstance()->is_enabled(); | 211 return PlatformParentalControlsValue::GetInstance()->is_enabled(); |
| 211 #elif defined(OS_ANDROID) | 212 #elif BUILDFLAG(ANDROID_JAVA_UI) |
| 212 return chrome::android::ChromeApplication::AreParentalControlsEnabled(); | 213 return chrome::android::ChromeApplication::AreParentalControlsEnabled(); |
| 213 #else | 214 #else |
| 214 return false; | 215 return false; |
| 215 #endif | 216 #endif |
| 216 } | 217 } |
| 217 | 218 |
| OLD | NEW |