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

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

Issue 1528963002: Quirks Client for downloading and providing display profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DEPS Created 4 years, 11 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/display/quirks_client_delegate_impl.h"
6
7 #include "base/path_service.h"
8 #include "base/sys_info.h"
9 #include "chrome/browser/chromeos/login/startup_utils.h"
10 #include "chrome/common/chrome_paths.h"
11 #include "chromeos/chromeos_paths.h"
12 #include "google_apis/google_api_keys.h"
13
14 namespace quirks_client {
15
16 QuirksClientDelegateImpl::QuirksClientDelegateImpl(
17 base::MessageLoopForUI* message_loop_ui,
18 base::SequencedWorkerPool* blocking_pool,
19 PrefService* local_state,
20 net::URLRequestContextGetter* url_context_getter)
21 : QuirksClientDelegate(message_loop_ui,
22 blocking_pool,
23 local_state,
24 url_context_getter) {}
25
26 QuirksClientDelegateImpl::~QuirksClientDelegateImpl() {}
27
28 std::string QuirksClientDelegateImpl::api_key_quirks() {
29 return google_apis::GetAPIKey();
30 }
31
32 // Returns the path to the writable display profile directory.
33 // On chrome device, returns /var/cache/display_profiles.
34 // On Linux desktop, returns {DIR_USER_DATA}/display_profiles.
35 // Either directory must be created beforehand.
36 base::FilePath QuirksClientDelegateImpl::GetDisplayProfileDirectory() {
37 base::FilePath directory;
38 if (base::SysInfo::IsRunningOnChromeOS()) {
39 PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory);
40 } else {
41 PathService::Get(chrome::DIR_USER_DATA, &directory);
42 directory = directory.Append("display_profiles");
43 }
44 return directory;
45 }
46
47 int QuirksClientDelegateImpl::GetDaysSinceOobe() {
48 return chromeos::StartupUtils::GetTimeSinceOobeFlagFileCreation().InDays();
49 }
50
51 } // namespace quirks_client
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698