Commit 88b034e5 authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

cryptauth: Move the chrome/browser implementation to c/b/chromeos.

Since this feature is CrOS-only.

Bug: none
Test: none
Change-Id: I85efa428462e6073c7da284b5282e287158c29e5
Reviewed-on: https://chromium-review.googlesource.com/961664Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarDan Erat <derat@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avataranthonyvd <anthonyvd@chromium.org>
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543121}
parent 3ecc16b9
...@@ -2371,10 +2371,6 @@ jumbo_split_static_library("browser") { ...@@ -2371,10 +2371,6 @@ jumbo_split_static_library("browser") {
"chrome_browser_main_posix.h", "chrome_browser_main_posix.h",
"chrome_process_singleton.cc", "chrome_process_singleton.cc",
"chrome_process_singleton.h", "chrome_process_singleton.h",
"cryptauth/chrome_cryptauth_service.cc",
"cryptauth/chrome_cryptauth_service.h",
"cryptauth/chrome_cryptauth_service_factory.cc",
"cryptauth/chrome_cryptauth_service_factory.h",
"custom_handlers/register_protocol_handler_permission_request.cc", "custom_handlers/register_protocol_handler_permission_request.cc",
"custom_handlers/register_protocol_handler_permission_request.h", "custom_handlers/register_protocol_handler_permission_request.h",
"diagnostics/diagnostics_controller.cc", "diagnostics/diagnostics_controller.cc",
...@@ -2785,8 +2781,6 @@ jumbo_split_static_library("browser") { ...@@ -2785,8 +2781,6 @@ jumbo_split_static_library("browser") {
"//chrome/browser/resources:component_extension_resources", "//chrome/browser/resources:component_extension_resources",
"//chrome/browser/search:generated", "//chrome/browser/search:generated",
"//chrome/common/importer:interfaces", "//chrome/common/importer:interfaces",
"//components/cryptauth",
"//components/cryptauth/proto",
"//components/feedback", "//components/feedback",
"//components/keep_alive_registry", "//components/keep_alive_registry",
"//components/vector_icons", "//components/vector_icons",
......
...@@ -81,6 +81,7 @@ source_set("chromeos") { ...@@ -81,6 +81,7 @@ source_set("chromeos") {
"//components/crash/content/app", "//components/crash/content/app",
"//components/crx_file", "//components/crx_file",
"//components/cryptauth", "//components/cryptauth",
"//components/cryptauth/proto",
"//components/device_event_log", "//components/device_event_log",
"//components/download/content/public", "//components/download/content/public",
"//components/drive", "//components/drive",
...@@ -489,6 +490,10 @@ source_set("chromeos") { ...@@ -489,6 +490,10 @@ source_set("chromeos") {
"chrome_browser_main_chromeos.h", "chrome_browser_main_chromeos.h",
"chrome_service_name.cc", "chrome_service_name.cc",
"chrome_service_name.h", "chrome_service_name.h",
"cryptauth/chrome_cryptauth_service.cc",
"cryptauth/chrome_cryptauth_service.h",
"cryptauth/chrome_cryptauth_service_factory.cc",
"cryptauth/chrome_cryptauth_service_factory.h",
"customization/customization_document.cc", "customization/customization_document.cc",
"customization/customization_document.h", "customization/customization_document.h",
"customization/customization_wallpaper_downloader.cc", "customization/customization_wallpaper_downloader.cc",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/cryptauth/chrome_cryptauth_service.h" #include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service.h"
#include "base/guid.h" #include "base/guid.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#endif #endif
namespace chromeos {
namespace { namespace {
std::string GetDeviceId() { std::string GetDeviceId() {
...@@ -359,3 +361,5 @@ void ChromeCryptAuthService::OnPrefsChanged() { ...@@ -359,3 +361,5 @@ void ChromeCryptAuthService::OnPrefsChanged() {
// off. // off.
PerformEnrollmentAndDeviceSyncIfPossible(); PerformEnrollmentAndDeviceSyncIfPossible();
} }
} // namespace chromeos
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_H_ #ifndef CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_H_
#define CHROME_BROWSER_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_H_ #define CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_H_
#include <memory> #include <memory>
...@@ -23,6 +23,8 @@ namespace cryptauth { ...@@ -23,6 +23,8 @@ namespace cryptauth {
class CryptAuthGCMManager; class CryptAuthGCMManager;
} // namespace cryptauth } // namespace cryptauth
namespace chromeos {
// Implementation of cryptauth::CryptAuthService. // Implementation of cryptauth::CryptAuthService.
class ChromeCryptAuthService class ChromeCryptAuthService
: public KeyedService, : public KeyedService,
...@@ -90,4 +92,6 @@ class ChromeCryptAuthService ...@@ -90,4 +92,6 @@ class ChromeCryptAuthService
DISALLOW_COPY_AND_ASSIGN(ChromeCryptAuthService); DISALLOW_COPY_AND_ASSIGN(ChromeCryptAuthService);
}; };
#endif // CHROME_BROWSER_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_H_ } // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_H_
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h" #include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/cryptauth/chrome_cryptauth_service.h" #include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service.h"
#include "chrome/browser/gcm/gcm_profile_service_factory.h" #include "chrome/browser/gcm/gcm_profile_service_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
namespace chromeos {
// static // static
cryptauth::CryptAuthService* cryptauth::CryptAuthService*
ChromeCryptAuthServiceFactory::GetForBrowserContext( ChromeCryptAuthServiceFactory::GetForBrowserContext(
...@@ -46,3 +48,5 @@ void ChromeCryptAuthServiceFactory::RegisterProfilePrefs( ...@@ -46,3 +48,5 @@ void ChromeCryptAuthServiceFactory::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) { user_prefs::PrefRegistrySyncable* registry) {
cryptauth::CryptAuthService::RegisterProfilePrefs(registry); cryptauth::CryptAuthService::RegisterProfilePrefs(registry);
} }
} // namespace chromeos
...@@ -2,14 +2,16 @@ ...@@ -2,14 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_FACTORY_H_ #ifndef CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_FACTORY_H_
#define CHROME_BROWSER_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_FACTORY_H_ #define CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_FACTORY_H_
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "components/cryptauth/cryptauth_service.h" #include "components/cryptauth/cryptauth_service.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
namespace chromeos {
// Factory which is used to access the CryptAuthService singleton. // Factory which is used to access the CryptAuthService singleton.
class ChromeCryptAuthServiceFactory : public BrowserContextKeyedServiceFactory { class ChromeCryptAuthServiceFactory : public BrowserContextKeyedServiceFactory {
public: public:
...@@ -33,4 +35,6 @@ class ChromeCryptAuthServiceFactory : public BrowserContextKeyedServiceFactory { ...@@ -33,4 +35,6 @@ class ChromeCryptAuthServiceFactory : public BrowserContextKeyedServiceFactory {
DISALLOW_COPY_AND_ASSIGN(ChromeCryptAuthServiceFactory); DISALLOW_COPY_AND_ASSIGN(ChromeCryptAuthServiceFactory);
}; };
#endif // CHROME_BROWSER_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_FACTORY_H_ } // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CHROME_CRYPTAUTH_SERVICE_FACTORY_H_
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
#include "base/sys_info.h" #include "base/sys_info.h"
#include "base/version.h" #include "base/version.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_signin_chromeos.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_signin_chromeos.h"
#include "chrome/browser/chromeos/login/easy_unlock/secure_message_delegate_chromeos.h" #include "chrome/browser/chromeos/login/easy_unlock/secure_message_delegate_chromeos.h"
#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_window.h" #include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
...@@ -129,8 +129,8 @@ ChromeProximityAuthClient::GetCryptAuthDeviceManager() { ...@@ -129,8 +129,8 @@ ChromeProximityAuthClient::GetCryptAuthDeviceManager() {
} }
cryptauth::CryptAuthService* ChromeProximityAuthClient::GetCryptAuthService() { cryptauth::CryptAuthService* ChromeProximityAuthClient::GetCryptAuthService() {
return ChromeCryptAuthServiceFactory::GetInstance()->GetForBrowserContext( return chromeos::ChromeCryptAuthServiceFactory::GetInstance()
profile_); ->GetForBrowserContext(profile_);
} }
std::string ChromeProximityAuthClient::GetLocalDevicePublicKey() { std::string ChromeProximityAuthClient::GetLocalDevicePublicKey() {
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_app_manager.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_app_manager.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_signin_chromeos.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_signin_chromeos.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_factory.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_factory.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
#include "base/values.h" #include "base/values.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/chromeos/login/easy_unlock/chrome_proximity_auth_client.h" #include "chrome/browser/chromeos/login/easy_unlock/chrome_proximity_auth_client.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_notification_controller.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_notification_controller.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.h" #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h" #include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/gcm/gcm_profile_service_factory.h" #include "chrome/browser/gcm/gcm_profile_service_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/tether/tether_service_factory.h" #include "chrome/browser/chromeos/tether/tether_service_factory.h"
#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/ash/network/tether_notification_presenter.h" #include "chrome/browser/ui/ash/network/tether_notification_presenter.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/chromeos/tether/fake_tether_service.h" #include "chrome/browser/chromeos/tether/fake_tether_service.h"
#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h" #include "chromeos/chromeos_switches.h"
...@@ -36,7 +36,7 @@ TetherServiceFactory::TetherServiceFactory() ...@@ -36,7 +36,7 @@ TetherServiceFactory::TetherServiceFactory()
: BrowserContextKeyedServiceFactory( : BrowserContextKeyedServiceFactory(
"TetherService", "TetherService",
BrowserContextDependencyManager::GetInstance()) { BrowserContextDependencyManager::GetInstance()) {
DependsOn(ChromeCryptAuthServiceFactory::GetInstance()); DependsOn(chromeos::ChromeCryptAuthServiceFactory::GetInstance());
} }
TetherServiceFactory::~TetherServiceFactory() {} TetherServiceFactory::~TetherServiceFactory() {}
...@@ -50,7 +50,7 @@ KeyedService* TetherServiceFactory::BuildServiceInstanceFor( ...@@ -50,7 +50,7 @@ KeyedService* TetherServiceFactory::BuildServiceInstanceFor(
FakeTetherService* fake_tether_service = new FakeTetherService( FakeTetherService* fake_tether_service = new FakeTetherService(
Profile::FromBrowserContext(context), Profile::FromBrowserContext(context),
chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), chromeos::DBusThreadManager::Get()->GetPowerManagerClient(),
ChromeCryptAuthServiceFactory::GetForBrowserContext( chromeos::ChromeCryptAuthServiceFactory::GetForBrowserContext(
Profile::FromBrowserContext(context)), Profile::FromBrowserContext(context)),
chromeos::NetworkHandler::Get()->network_state_handler(), chromeos::NetworkHandler::Get()->network_state_handler(),
session_manager::SessionManager::Get()); session_manager::SessionManager::Get());
...@@ -67,7 +67,7 @@ KeyedService* TetherServiceFactory::BuildServiceInstanceFor( ...@@ -67,7 +67,7 @@ KeyedService* TetherServiceFactory::BuildServiceInstanceFor(
return new TetherService( return new TetherService(
Profile::FromBrowserContext(context), Profile::FromBrowserContext(context),
chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), chromeos::DBusThreadManager::Get()->GetPowerManagerClient(),
ChromeCryptAuthServiceFactory::GetForBrowserContext( chromeos::ChromeCryptAuthServiceFactory::GetForBrowserContext(
Profile::FromBrowserContext(context)), Profile::FromBrowserContext(context)),
chromeos::NetworkHandler::Get()->network_state_handler(), chromeos::NetworkHandler::Get()->network_state_handler(),
session_manager::SessionManager::Get()); session_manager::SessionManager::Get());
......
...@@ -91,7 +91,6 @@ ...@@ -91,7 +91,6 @@
#include "chrome/browser/android/data_usage/data_use_ui_tab_model_factory.h" #include "chrome/browser/android/data_usage/data_use_ui_tab_model_factory.h"
#include "chrome/browser/android/search_permissions/search_permissions_service.h" #include "chrome/browser/android/search_permissions/search_permissions_service.h"
#else #else
#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/search/instant_service_factory.h" #include "chrome/browser/search/instant_service_factory.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/browser/ui/global_error/global_error_service_factory.h"
#include "chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h" #include "chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h"
...@@ -99,6 +98,7 @@ ...@@ -99,6 +98,7 @@
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/cryptauth/chrome_cryptauth_service_factory.h"
#include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.h" #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.h"
#include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
#include "chrome/browser/chromeos/policy/recommendation_restorer_factory.h" #include "chrome/browser/chromeos/policy/recommendation_restorer_factory.h"
...@@ -224,8 +224,8 @@ EnsureBrowserContextKeyedServiceFactoriesBuilt() { ...@@ -224,8 +224,8 @@ EnsureBrowserContextKeyedServiceFactoriesBuilt() {
android::DataUseUITabModelFactory::GetInstance(); android::DataUseUITabModelFactory::GetInstance();
#endif #endif
ChromeBrowsingDataRemoverDelegateFactory::GetInstance(); ChromeBrowsingDataRemoverDelegateFactory::GetInstance();
#if !defined(OS_ANDROID) #if defined(OS_CHROMEOS)
ChromeCryptAuthServiceFactory::GetInstance(); chromeos::ChromeCryptAuthServiceFactory::GetInstance();
#endif #endif
ChromeSigninClientFactory::GetInstance(); ChromeSigninClientFactory::GetInstance();
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(OS_CHROMEOS) #if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(OS_CHROMEOS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment