Skip to content

Commit

Permalink
Move chrome/browser/{chromeos => ash}/cryptauth/
Browse files Browse the repository at this point in the history
Also, the affected files are moved from namespace chromeos to ash.

This CL is part of the Chrome OS source code directory migration:
https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE.

Bug: 1164001
Change-Id: I10e54b9e5786940dda2027f65440d3b1fdf3b764
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3169717
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Owners-Override: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924211}
  • Loading branch information
hferreiro authored and Chromium LUCI CQ committed Sep 23, 2021
1 parent 7cfc859 commit 2029590
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 56 deletions.
2 changes: 1 addition & 1 deletion WATCHLISTS
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@
},
'multidevice': {
'filepath': 'ash/multi_device_setup/'\
'|chrome/browser/chromeos/cryptauth/'\
'|chrome/browser/ash/cryptauth/'\
'|chrome/browser/chromeos/device_sync/'\
'|chrome/browser/chromeos/multidevice_setup/'\
'|chrome/browser/chromeos/secure_channel/'\
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h"

#include <string>

Expand All @@ -18,8 +18,8 @@
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "base/version.h"
#include "chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chromeos/cryptauth/cryptauth_device_id_provider_impl.h"
#include "chrome/common/pref_names.h"
#include "chromeos/components/multidevice/logging/logging.h"
#include "chromeos/network/network_state_handler.h"
Expand All @@ -34,7 +34,7 @@
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"

namespace chromeos {
namespace ash {

namespace {

Expand Down Expand Up @@ -338,7 +338,7 @@ void ClientAppMetadataProviderService::OnInstanceIdTokenFetched(
metadata.set_device_type(cryptauthv2::ClientAppMetadata_DeviceType_CHROME);

metadata.set_using_secure_screenlock(
pref_service_->GetBoolean(ash::prefs::kEnableAutoScreenLock));
pref_service_->GetBoolean(prefs::kEnableAutoScreenLock));
// Auto-unlock here refers to concepts such as "trusted places" and "trusted
// peripherals." Chromebooks do support Smart Lock (i.e., unlocking via the
// user's phone), but these fields are unrelated.
Expand Down Expand Up @@ -424,4 +424,4 @@ void ClientAppMetadataProviderService::InvokePendingCallbacks() {
}
}

} // namespace chromeos
} // namespace ash
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_H_
#define CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_H_
#ifndef CHROME_BROWSER_ASH_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_H_
#define CHROME_BROWSER_ASH_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_H_

#include <list>

Expand All @@ -12,6 +12,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/system/sys_info.h"
// TODO(https://crbug.com/1164001): move to forward declaration.
#include "chromeos/network/network_state_handler.h"
#include "chromeos/services/device_sync/proto/cryptauth_client_app_metadata.pb.h"
#include "chromeos/services/device_sync/public/cpp/client_app_metadata_provider.h"
#include "components/gcm_driver/instance_id/instance_id.h"
Expand All @@ -30,9 +32,7 @@ class InstanceID;
class InstanceIDProfileService;
} // namespace instance_id

namespace chromeos {

class NetworkStateHandler;
namespace ash {

// Concrete ClientAppMetadataProvider implementation, which lazily computes the
// ClientAppMetadata when GetClientAppMetadata() is called. Once the
Expand Down Expand Up @@ -111,6 +111,6 @@ class ClientAppMetadataProviderService
this};
};

} // namespace chromeos
} // namespace ash

#endif // CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_H_
#endif // CHROME_BROWSER_ASH_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/cryptauth/client_app_metadata_provider_service_factory.h"
#include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service_factory.h"

#include "chrome/browser/chromeos/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/gcm/instance_id/instance_id_profile_service_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/network/network_handler.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"

namespace chromeos {
namespace ash {

// static
ClientAppMetadataProviderService*
Expand Down Expand Up @@ -48,4 +48,4 @@ KeyedService* ClientAppMetadataProviderServiceFactory::BuildServiceInstanceFor(
instance_id::InstanceIDProfileServiceFactory::GetForProfile(profile));
}

} // namespace chromeos
} // namespace ash
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_FACTORY_H_
#define CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_FACTORY_H_
#ifndef CHROME_BROWSER_ASH_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_FACTORY_H_
#define CHROME_BROWSER_ASH_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_FACTORY_H_

#include "base/macros.h"
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"

class Profile;

namespace chromeos {
namespace ash {

class ClientAppMetadataProviderService;

Expand All @@ -36,6 +36,11 @@ class ClientAppMetadataProviderServiceFactory
DISALLOW_COPY_AND_ASSIGN(ClientAppMetadataProviderServiceFactory);
};

} // namespace chromeos
} // namespace ash

// TODO(https://crbug.com/1164001): remove after the migration is finished.
namespace chromeos {
using ::ash::ClientAppMetadataProviderServiceFactory;
}

#endif // CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_FACTORY_H_
#endif // CHROME_BROWSER_ASH_CRYPTAUTH_CLIENT_APP_METADATA_PROVIDER_SERVICE_FACTORY_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h"

#include "testing/gtest/include/gtest/gtest.h"

namespace chromeos {
namespace ash {

// Note: Actual service code does not currently have a test, since it would be a
// "change detector test" (i.e., it would simply verify that the values provided
Expand All @@ -23,4 +23,4 @@ TEST(ClientAppMetadataProviderServiceTest, VersionCodeToInt64) {
"NotAVersionStringAtAll"));
}

} // namespace chromeos
} // namespace ash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/cryptauth/cryptauth_device_id_provider_impl.h"
#include "chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h"

#include "base/guid.h"
#include "chrome/browser/browser_process.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CRYPTAUTH_DEVICE_ID_PROVIDER_IMPL_H_
#define CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CRYPTAUTH_DEVICE_ID_PROVIDER_IMPL_H_
#ifndef CHROME_BROWSER_ASH_CRYPTAUTH_CRYPTAUTH_DEVICE_ID_PROVIDER_IMPL_H_
#define CHROME_BROWSER_ASH_CRYPTAUTH_CRYPTAUTH_DEVICE_ID_PROVIDER_IMPL_H_

#include <string>

Expand Down Expand Up @@ -39,4 +39,4 @@ class CryptAuthDeviceIdProviderImpl

} // namespace cryptauth

#endif // CHROME_BROWSER_CHROMEOS_CRYPTAUTH_CRYPTAUTH_DEVICE_ID_PROVIDER_IMPL_H_
#endif // CHROME_BROWSER_ASH_CRYPTAUTH_CRYPTAUTH_DEVICE_ID_PROVIDER_IMPL_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/cryptauth/gcm_device_info_provider_impl.h"
#include "chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.h"

#include <stddef.h>
#include <stdint.h>
Expand All @@ -14,11 +14,11 @@
#include "base/no_destructor.h"
#include "base/system/sys_info.h"
#include "base/version.h"
#include "chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chromeos/cryptauth/cryptauth_device_id_provider_impl.h"
#include "components/version_info/version_info.h"

namespace chromeos {
namespace ash {

namespace {

Expand Down Expand Up @@ -115,4 +115,4 @@ const cryptauth::GcmDeviceInfo& GcmDeviceInfoProviderImpl::GetGcmDeviceInfo()

GcmDeviceInfoProviderImpl::GcmDeviceInfoProviderImpl() = default;

} // namespace chromeos
} // namespace ash
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_CHROMEOS_CRYPTAUTH_GCM_DEVICE_INFO_PROVIDER_IMPL_H_
#define CHROME_BROWSER_CHROMEOS_CRYPTAUTH_GCM_DEVICE_INFO_PROVIDER_IMPL_H_
#ifndef CHROME_BROWSER_ASH_CRYPTAUTH_GCM_DEVICE_INFO_PROVIDER_IMPL_H_
#define CHROME_BROWSER_ASH_CRYPTAUTH_GCM_DEVICE_INFO_PROVIDER_IMPL_H_

#include "base/macros.h"
#include "base/no_destructor.h"
#include "chromeos/services/device_sync/proto/cryptauth_api.pb.h"
#include "chromeos/services/device_sync/public/cpp/gcm_device_info_provider.h"

namespace chromeos {
namespace ash {

// Concrete GcmDeviceInfoProvider implementation.
class GcmDeviceInfoProviderImpl : public device_sync::GcmDeviceInfoProvider {
Expand All @@ -28,6 +28,11 @@ class GcmDeviceInfoProviderImpl : public device_sync::GcmDeviceInfoProvider {
DISALLOW_COPY_AND_ASSIGN(GcmDeviceInfoProviderImpl);
};

} // namespace chromeos
} // namespace ash

// TODO(https://crbug.com/1164001): remove after the migration is finished.
namespace chromeos {
using ::ash::GcmDeviceInfoProviderImpl;
}

#endif // CHROME_BROWSER_CHROMEOS_CRYPTAUTH_GCM_DEVICE_INFO_PROVIDER_IMPL_H_
#endif // CHROME_BROWSER_ASH_CRYPTAUTH_GCM_DEVICE_INFO_PROVIDER_IMPL_H_
18 changes: 9 additions & 9 deletions chrome/browser/chromeos/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,14 @@ source_set("chromeos") {
"../ash/crostini/throttle/crostini_active_window_throttle_observer.h",
"../ash/crostini/throttle/crostini_throttle.cc",
"../ash/crostini/throttle/crostini_throttle.h",
"../ash/cryptauth/client_app_metadata_provider_service.cc",
"../ash/cryptauth/client_app_metadata_provider_service.h",
"../ash/cryptauth/client_app_metadata_provider_service_factory.cc",
"../ash/cryptauth/client_app_metadata_provider_service_factory.h",
"../ash/cryptauth/cryptauth_device_id_provider_impl.cc",
"../ash/cryptauth/cryptauth_device_id_provider_impl.h",
"../ash/cryptauth/gcm_device_info_provider_impl.cc",
"../ash/cryptauth/gcm_device_info_provider_impl.h",
"../ash/customization/customization_document.cc",
"../ash/customization/customization_document.h",
"../ash/customization/customization_wallpaper_downloader.cc",
Expand Down Expand Up @@ -2895,14 +2903,6 @@ source_set("chromeos") {
"chrome_content_browser_client_chromeos_part.h",
"concierge_helper_service.cc",
"concierge_helper_service.h",
"cryptauth/client_app_metadata_provider_service.cc",
"cryptauth/client_app_metadata_provider_service.h",
"cryptauth/client_app_metadata_provider_service_factory.cc",
"cryptauth/client_app_metadata_provider_service_factory.h",
"cryptauth/cryptauth_device_id_provider_impl.cc",
"cryptauth/cryptauth_device_id_provider_impl.h",
"cryptauth/gcm_device_info_provider_impl.cc",
"cryptauth/gcm_device_info_provider_impl.h",
"device_name/device_name_applier.h",
"device_name/device_name_applier_impl.cc",
"device_name/device_name_applier_impl.h",
Expand Down Expand Up @@ -3887,6 +3887,7 @@ source_set("unit_tests") {
"../ash/crostini/termina_installer_unittest.cc",
"../ash/crostini/throttle/crostini_active_window_throttle_observer_unittest.cc",
"../ash/crostini/throttle/crostini_throttle_unittest.cc",
"../ash/cryptauth/client_app_metadata_provider_service_unittest.cc",
"../ash/customization/customization_document_unittest.cc",
"../ash/dbus/encrypted_reporting_service_provider_unittest.cc",
"../ash/dbus/proxy_resolution_service_provider_unittest.cc",
Expand Down Expand Up @@ -4316,7 +4317,6 @@ source_set("unit_tests") {
"app_mode/kiosk_session_plugin_handler_unittest.cc",
"chrome_content_browser_client_chromeos_part_unittest.cc",
"concierge_helper_service_unittest.cc",
"cryptauth/client_app_metadata_provider_service_unittest.cc",
"device_name/device_name_applier_impl_unittest.cc",
"device_name/device_name_store_impl_unittest.cc",
"device_name/device_name_validator_unittest.cc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "base/macros.h"
#include "base/timer/timer.h"
#include "chrome/browser/chromeos/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/chromeos/cryptauth/client_app_metadata_provider_service_factory.h"
#include "chrome/browser/chromeos/cryptauth/gcm_device_info_provider_impl.h"
#include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service_factory.h"
#include "chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.h"
#include "chrome/browser/gcm/gcm_profile_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
Expand Down Expand Up @@ -43,8 +43,8 @@ std::unique_ptr<DeviceSyncBase> CreateDeviceSyncImplForProfile(
return DeviceSyncImpl::Factory::Create(
IdentityManagerFactory::GetForProfile(profile),
gcm::GCMProfileServiceFactory::GetForProfile(profile)->driver(),
profile->GetPrefs(), chromeos::GcmDeviceInfoProviderImpl::GetInstance(),
chromeos::ClientAppMetadataProviderServiceFactory::GetForProfile(profile),
profile->GetPrefs(), GcmDeviceInfoProviderImpl::GetInstance(),
ClientAppMetadataProviderServiceFactory::GetForProfile(profile),
profile->GetURLLoaderFactory(), std::make_unique<base::OneShotTimer>());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "chrome/browser/ash/android_sms/android_sms_pairing_state_tracker_impl.h"
#include "chrome/browser/ash/android_sms/android_sms_service_factory.h"
#include "chrome/browser/ash/authpolicy/authpolicy_credentials_manager.h"
#include "chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/chromeos/cryptauth/gcm_device_info_provider_impl.h"
#include "chrome/browser/chromeos/device_sync/device_sync_client_factory.h"
#include "chrome/browser/chromeos/multidevice_setup/auth_token_validator_factory.h"
#include "chrome/browser/chromeos/multidevice_setup/auth_token_validator_impl.h"
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/prefs/browser_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@
#include "chrome/browser/ash/child_accounts/time_limits/app_time_controller.h"
#include "chrome/browser/ash/crosapi/browser_util.h"
#include "chrome/browser/ash/crostini/crostini_pref_names.h"
#include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h"
#include "chrome/browser/ash/customization/customization_document.h"
#include "chrome/browser/ash/file_system_provider/registry.h"
#include "chrome/browser/ash/first_run/first_run.h"
Expand Down Expand Up @@ -342,8 +344,6 @@
#include "chrome/browser/ash/settings/device_settings_cache.h"
#include "chrome/browser/ash/system/automatic_reboot_manager.h"
#include "chrome/browser/ash/system/input_device_settings.h"
#include "chrome/browser/chromeos/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/chromeos/cryptauth/cryptauth_device_id_provider_impl.h"
#include "chrome/browser/chromeos/extensions/echo_private_api.h"
#include "chrome/browser/chromeos/extensions/login_screen/login/login_api.h"
#include "chrome/browser/chromeos/net/network_throttling_observer.h"
Expand Down Expand Up @@ -1303,7 +1303,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
ash::app_time::AppTimeController::RegisterProfilePrefs(registry);
chromeos::assistant::prefs::RegisterProfilePrefs(registry);
ash::bluetooth::DebugLogsManager::RegisterPrefs(registry);
chromeos::ClientAppMetadataProviderService::RegisterProfilePrefs(registry);
ash::ClientAppMetadataProviderService::RegisterProfilePrefs(registry);
chromeos::CupsPrintersManager::RegisterProfilePrefs(registry);
chromeos::device_sync::RegisterProfilePrefs(registry);
ash::FamilyUserChromeActivityMetrics::RegisterProfilePrefs(registry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,11 @@ class ClientAppMetadataProvider {

} // namespace chromeos

// TODO(https://crbug.com/1164001): remove after the migration is finished.
namespace ash {
namespace device_sync {
using ::chromeos::device_sync::ClientAppMetadataProvider;
}
} // namespace ash

#endif // CHROMEOS_SERVICES_DEVICE_SYNC_PUBLIC_CPP_CLIENT_APP_METADATA_PROVIDER_H_
8 changes: 8 additions & 0 deletions chromeos/services/device_sync/public/cpp/gcm_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@ extern const char kCryptAuthV2EnrollmentAuthorizedEntity[];

} // namespace chromeos

// TODO(https://crbug.com/1164001): remove after the migration is finished.
namespace ash {
namespace device_sync {
using ::chromeos::device_sync::kCryptAuthGcmAppId;
using ::chromeos::device_sync::kCryptAuthV2EnrollmentAuthorizedEntity;
} // namespace device_sync
} // namespace ash

#endif // CHROMEOS_SERVICES_DEVICE_SYNC_PUBLIC_CPP_GCM_CONSTANTS_H_
Loading

0 comments on commit 2029590

Please sign in to comment.