OLD | NEW |
(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/common/chrome_paths.h" |
| 10 #include "chromeos/chromeos_paths.h" |
| 11 #include "google_apis/google_api_keys.h" |
| 12 |
| 13 namespace quirks_client { |
| 14 |
| 15 QuirksClientDelegateImpl::QuirksClientDelegateImpl( |
| 16 base::MessageLoopForUI* message_loop_ui, |
| 17 base::SequencedWorkerPool* blocking_pool, |
| 18 PrefService* local_state, |
| 19 net::URLRequestContextGetter* url_context_getter) |
| 20 : QuirksClientDelegate(message_loop_ui, blocking_pool, |
| 21 local_state, url_context_getter) {} |
| 22 |
| 23 QuirksClientDelegateImpl::~QuirksClientDelegateImpl() {} |
| 24 |
| 25 // TODO!!! We're still sorting out the details of which key to use. This code |
| 26 // is just here temporarily replacing the currently working api key. |
| 27 std::string QuirksClientDelegateImpl::api_key_quirks() { |
| 28 return google_apis::GetAPIKey(); |
| 29 } |
| 30 |
| 31 // Returns the path to the writable display profile directory. |
| 32 // On chrome device, returns /var/cache/display_profiles. |
| 33 // On Linux desktop, returns {DIR_USER_DATA}/display_profiles. |
| 34 // Either directory must be created beforehand. |
| 35 base::FilePath QuirksClientDelegateImpl::GetDisplayProfileDirectory() { |
| 36 base::FilePath directory; |
| 37 if (base::SysInfo::IsRunningOnChromeOS()) { |
| 38 PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory); |
| 39 } else { |
| 40 PathService::Get(chrome::DIR_USER_DATA, &directory); |
| 41 directory = directory.Append("display_profiles"); |
| 42 } |
| 43 return directory; |
| 44 } |
| 45 |
| 46 } // namespace quirks_client |
OLD | NEW |