| Index: chrome/browser/chromeos/display/quirks_client_delegate_impl.cc
|
| diff --git a/chrome/browser/chromeos/display/quirks_client_delegate_impl.cc b/chrome/browser/chromeos/display/quirks_client_delegate_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5b4e3c3eba24e0cfa810e60b2343edd0083aefc5
|
| --- /dev/null
|
| +++ b/chrome/browser/chromeos/display/quirks_client_delegate_impl.cc
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/chromeos/display/quirks_client_delegate_impl.h"
|
| +
|
| +#include "base/path_service.h"
|
| +#include "base/sys_info.h"
|
| +#include "chrome/common/chrome_paths.h"
|
| +#include "chromeos/chromeos_paths.h"
|
| +#include "google_apis/google_api_keys.h"
|
| +
|
| +namespace quirks_client {
|
| +
|
| +QuirksClientDelegateImpl::QuirksClientDelegateImpl(
|
| + base::MessageLoopForUI* message_loop_ui,
|
| + base::SequencedWorkerPool* blocking_pool,
|
| + PrefService* local_state,
|
| + net::URLRequestContextGetter* url_context_getter)
|
| + : QuirksClientDelegate(message_loop_ui, blocking_pool,
|
| + local_state, url_context_getter) {}
|
| +
|
| +QuirksClientDelegateImpl::~QuirksClientDelegateImpl() {}
|
| +
|
| +// TODO!!! We're still sorting out the details of which key to use. This code
|
| +// is just here temporarily replacing the currently working api key.
|
| +std::string QuirksClientDelegateImpl::api_key_quirks() {
|
| + return google_apis::GetAPIKey();
|
| +}
|
| +
|
| +// Returns the path to the writable display profile directory.
|
| +// On chrome device, returns /var/cache/display_profiles.
|
| +// On Linux desktop, returns {DIR_USER_DATA}/display_profiles.
|
| +// Either directory must be created beforehand.
|
| +base::FilePath QuirksClientDelegateImpl::GetDisplayProfileDirectory() {
|
| + base::FilePath directory;
|
| + if (base::SysInfo::IsRunningOnChromeOS()) {
|
| + PathService::Get(chromeos::DIR_DEVICE_DISPLAY_PROFILES, &directory);
|
| + } else {
|
| + PathService::Get(chrome::DIR_USER_DATA, &directory);
|
| + directory = directory.Append("display_profiles");
|
| + }
|
| + return directory;
|
| +}
|
| +
|
| +} // namespace quirks_client
|
|
|