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

Side by Side Diff: chrome/browser/chromeos/display/quirks_manager_delegate_impl.cc

Issue 1775023002: Enterprise policy to prevent queries to the Quirks Server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix display unit test Created 4 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/display/quirks_manager_delegate_impl.h" 5 #include "chrome/browser/chromeos/display/quirks_manager_delegate_impl.h"
6 6
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "base/task_runner_util.h" 9 #include "base/task_runner_util.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
11 #include "chrome/browser/chromeos/login/startup_utils.h" 11 #include "chrome/browser/chromeos/login/startup_utils.h"
12 #include "chrome/browser/chromeos/settings/cros_settings.h"
12 #include "chrome/common/chrome_paths.h" 13 #include "chrome/common/chrome_paths.h"
13 #include "chromeos/chromeos_paths.h" 14 #include "chromeos/chromeos_paths.h"
14 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
15 #include "google_apis/google_api_keys.h" 16 #include "google_apis/google_api_keys.h"
16 17
17 namespace { 18 namespace {
18 19
19 const char kUserDataDisplayProfilesDirectory[] = "display_profiles"; 20 const char kUserDataDisplayProfilesDirectory[] = "display_profiles";
20 21
21 int GetDaysSinceOobeOnBlockingPool() { 22 int GetDaysSinceOobeOnBlockingPool() {
(...skipping 23 matching lines...) Expand all
45 base::FilePath directory; 46 base::FilePath directory;
46 if (base::SysInfo::IsRunningOnChromeOS()) { 47 if (base::SysInfo::IsRunningOnChromeOS()) {
47 PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory); 48 PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory);
48 } else { 49 } else {
49 PathService::Get(chrome::DIR_USER_DATA, &directory); 50 PathService::Get(chrome::DIR_USER_DATA, &directory);
50 directory = directory.Append(kUserDataDisplayProfilesDirectory); 51 directory = directory.Append(kUserDataDisplayProfilesDirectory);
51 } 52 }
52 return directory; 53 return directory;
53 } 54 }
54 55
56 bool QuirksManagerDelegateImpl::DevicePolicyEnabled() const {
57 bool quirks_enabled = true;
58 chromeos::CrosSettings::Get()->GetBoolean(
59 chromeos::kDeviceQuirksDownloadEnabled, &quirks_enabled);
60 return quirks_enabled;
61 }
62
55 void QuirksManagerDelegateImpl::GetDaysSinceOobe( 63 void QuirksManagerDelegateImpl::GetDaysSinceOobe(
56 QuirksManager::DaysSinceOobeCallback callback) const { 64 QuirksManager::DaysSinceOobeCallback callback) const {
57 base::PostTaskAndReplyWithResult( 65 base::PostTaskAndReplyWithResult(
58 content::BrowserThread::GetBlockingPool(), FROM_HERE, 66 content::BrowserThread::GetBlockingPool(), FROM_HERE,
59 base::Bind(&GetDaysSinceOobeOnBlockingPool), callback); 67 base::Bind(&GetDaysSinceOobeOnBlockingPool), callback);
60 } 68 }
61 69
62 } // namespace quirks 70 } // namespace quirks
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698