From 0842edfa29d399390ee36619d7b21a0a1ce2071e Mon Sep 17 00:00:00 2001 From: Yeunjoo Choi Date: Thu, 29 Jul 2021 00:53:17 +0000 Subject: [PATCH] Change namespace chromeos => ash for //c/b/ash/full_restore Code in //chrome/browser/ash/full_restore is a part of the ash-chrome, so namespace is changed to ash from chromeos. To avoid churn during other namespace transitions in future, this CL has temporary 'using' declarations. This CL is part of the Chrome OS source code directory migration: https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE. Change-Id: I203e9b7378df2e6081d581f88caa7f4538d42190 Bug: 1164001 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3054274 Commit-Queue: Yeunjoo Choi Reviewed-by: Hidehiko Abe Owners-Override: Hidehiko Abe Cr-Commit-Position: refs/heads/master@{#906495} --- ash/shell_delegate.h | 2 +- ash/test_shell_delegate.cc | 2 +- ash/test_shell_delegate.h | 4 ++-- ash/wm/desks/desks_controller.cc | 2 +- .../browser/ash/arc/session/arc_service_launcher.cc | 2 +- .../browser/ash/full_restore/app_launch_handler.cc | 4 ++-- .../browser/ash/full_restore/app_launch_handler.h | 6 +++--- .../ash/full_restore/arc_app_launch_handler.cc | 4 ++-- .../ash/full_restore/arc_app_launch_handler.h | 7 ++++--- .../ash/full_restore/arc_ghost_window_delegate.cc | 8 ++++---- .../ash/full_restore/arc_ghost_window_delegate.h | 11 +++++------ .../full_restore/arc_ghost_window_shell_surface.cc | 6 ++---- .../full_restore/arc_ghost_window_shell_surface.h | 4 ++-- .../ash/full_restore/arc_ghost_window_view.cc | 6 +++--- .../ash/full_restore/arc_ghost_window_view.h | 6 +++--- .../full_restore/arc_ghost_window_view_unittest.cc | 4 ++-- .../browser/ash/full_restore/arc_window_handler.cc | 4 ++-- .../browser/ash/full_restore/arc_window_handler.h | 6 +++--- chrome/browser/ash/full_restore/arc_window_utils.cc | 4 ++-- chrome/browser/ash/full_restore/arc_window_utils.h | 4 ++-- .../ash/full_restore/arc_window_utils_unittest.cc | 4 ++-- .../full_restore/full_restore_app_launch_handler.cc | 6 +++--- .../full_restore/full_restore_app_launch_handler.h | 4 ++-- .../full_restore_app_launch_handler_browsertest.cc | 10 +++++----- .../full_restore/full_restore_arc_task_handler.cc | 4 ++-- .../full_restore/full_restore_arc_task_handler.h | 4 ++-- .../full_restore_arc_task_handler_factory.cc | 4 ++-- .../full_restore_arc_task_handler_factory.h | 4 ++-- .../ash/full_restore/full_restore_data_handler.cc | 4 ++-- .../ash/full_restore/full_restore_data_handler.h | 4 ++-- .../browser/ash/full_restore/full_restore_prefs.cc | 4 ++-- .../browser/ash/full_restore/full_restore_prefs.h | 4 ++-- .../ash/full_restore/full_restore_prefs_unittest.cc | 4 ++-- .../ash/full_restore/full_restore_service.cc | 10 +++++----- .../browser/ash/full_restore/full_restore_service.h | 12 ++---------- .../full_restore/full_restore_service_factory.cc | 4 ++-- .../ash/full_restore/full_restore_service_factory.h | 11 +++++++++-- .../full_restore/full_restore_service_unittest.cc | 4 ++-- .../full_restore/new_user_restore_pref_handler.cc | 6 +++--- .../full_restore/new_user_restore_pref_handler.h | 4 ++-- .../browser_context_keyed_service_factories.cc | 2 +- .../extensions/api/settings_private/prefs_util.cc | 2 +- chrome/browser/prefs/browser_prefs.cc | 2 +- chrome/browser/ui/ash/chrome_shell_delegate.cc | 2 +- chrome/browser/ui/ash/chrome_shell_delegate.h | 4 ++-- .../ui/ash/desk_template_app_launch_handler.cc | 10 +++++----- .../ui/ash/desk_template_app_launch_handler.h | 5 ++--- .../app_service_app_window_arc_tracker.cc | 4 ++-- .../ash/shelf/arc_shelf_spinner_item_controller.cc | 4 ++-- .../browser/ui/startup/startup_browser_creator.cc | 2 +- chrome/test/base/in_process_browser_test.cc | 2 +- chrome/test/base/in_process_browser_test.h | 4 ++-- components/full_restore/full_restore_read_handler.h | 13 ++++++------- 53 files changed, 129 insertions(+), 134 deletions(-) diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h index cef6cfc0b18ea..fb07fae218ddf 100644 --- a/ash/shell_delegate.h +++ b/ash/shell_delegate.h @@ -139,7 +139,7 @@ class ASH_EXPORT ShellDelegate { // data can be constructed, which can happen if the |window| does not have // an app id associated with it, or we're not in the primary active user // session. - virtual std::unique_ptr + virtual std::unique_ptr<::full_restore::AppLaunchInfo> GetAppLaunchDataForDeskTemplate(aura::Window* window) const = 0; }; diff --git a/ash/test_shell_delegate.cc b/ash/test_shell_delegate.cc index 7a8f525e85a4f..6b72454f228d5 100644 --- a/ash/test_shell_delegate.cc +++ b/ash/test_shell_delegate.cc @@ -93,7 +93,7 @@ base::FilePath TestShellDelegate::GetPrimaryUserDownloadsFolder() const { return base::FilePath(); } -std::unique_ptr +std::unique_ptr<::full_restore::AppLaunchInfo> TestShellDelegate::GetAppLaunchDataForDeskTemplate(aura::Window* window) const { return nullptr; } diff --git a/ash/test_shell_delegate.h b/ash/test_shell_delegate.h index 36da27f004083..1a62a26faf6eb 100644 --- a/ash/test_shell_delegate.h +++ b/ash/test_shell_delegate.h @@ -55,8 +55,8 @@ class TestShellDelegate : public ShellDelegate { bool IsLoggingRedirectDisabled() const override; base::FilePath GetPrimaryUserDownloadsFolder() const override; void OpenFeedbackPageForPersistentDesksBar() override {} - std::unique_ptr GetAppLaunchDataForDeskTemplate( - aura::Window* window) const override; + std::unique_ptr<::full_restore::AppLaunchInfo> + GetAppLaunchDataForDeskTemplate(aura::Window* window) const override; private: // True if the current top window can go back. diff --git a/ash/wm/desks/desks_controller.cc b/ash/wm/desks/desks_controller.cc index abb74ecd7c65c..400625d97b0db 100644 --- a/ash/wm/desks/desks_controller.cc +++ b/ash/wm/desks/desks_controller.cc @@ -878,7 +878,7 @@ std::unique_ptr DesksController::CaptureActiveDeskAsTemplate() auto mru_windows = shell->mru_window_tracker()->BuildMruWindowList(kActiveDesk); for (auto* window : mru_windows) { - std::unique_ptr app_launch_info = + std::unique_ptr<::full_restore::AppLaunchInfo> app_launch_info = shell->shell_delegate()->GetAppLaunchDataForDeskTemplate(window); if (!app_launch_info) continue; diff --git a/chrome/browser/ash/arc/session/arc_service_launcher.cc b/chrome/browser/ash/arc/session/arc_service_launcher.cc index 221c820982521..dce5315a2f74b 100644 --- a/chrome/browser/ash/arc/session/arc_service_launcher.cc +++ b/chrome/browser/ash/arc/session/arc_service_launcher.cc @@ -253,7 +253,7 @@ void ArcServiceLauncher::OnPrimaryUserProfilePrepared(Profile* profile) { CertStoreService::GetForBrowserContext(profile); apps::ArcAppsFactory::GetForProfile(profile); ash::ApkWebAppService::Get(profile); - chromeos::full_restore::FullRestoreArcTaskHandler::GetForProfile(profile); + ash::full_restore::FullRestoreArcTaskHandler::GetForProfile(profile); // ARC Container-only services. if (!arc::IsArcVmEnabled()) { diff --git a/chrome/browser/ash/full_restore/app_launch_handler.cc b/chrome/browser/ash/full_restore/app_launch_handler.cc index 80cd01da39ddc..89e73f856d019 100644 --- a/chrome/browser/ash/full_restore/app_launch_handler.cc +++ b/chrome/browser/ash/full_restore/app_launch_handler.cc @@ -22,7 +22,7 @@ #include "extensions/common/constants.h" #include "extensions/common/extension.h" -namespace chromeos { +namespace ash { namespace { @@ -213,4 +213,4 @@ void AppLaunchHandler::LaunchSystemWebAppOrChromeApp( } } -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/app_launch_handler.h b/chrome/browser/ash/full_restore/app_launch_handler.h index 7e1275aa9fd98..39acd35bc1605 100644 --- a/chrome/browser/ash/full_restore/app_launch_handler.h +++ b/chrome/browser/ash/full_restore/app_launch_handler.h @@ -13,11 +13,11 @@ namespace apps { class AppUpdate; enum class AppTypeName; -} +} // namespace apps class Profile; -namespace chromeos { +namespace ash { // The AppLaunchHandler class launches apps from `restore_data_` as well as // observes app updates. @@ -62,6 +62,6 @@ class AppLaunchHandler : public apps::AppRegistryCache::Observer { virtual void RecordRestoredAppLaunch(apps::AppTypeName app_type_name) = 0; }; -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_APP_LAUNCH_HANDLER_H_ diff --git a/chrome/browser/ash/full_restore/arc_app_launch_handler.cc b/chrome/browser/ash/full_restore/arc_app_launch_handler.cc index e4fb41ee3d873..70a37a318b01a 100644 --- a/chrome/browser/ash/full_restore/arc_app_launch_handler.cc +++ b/chrome/browser/ash/full_restore/arc_app_launch_handler.cc @@ -75,7 +75,7 @@ constexpr char kArcGhostWindowLaunchHistogram[] = "Apps.ArcGhostWindowLaunch"; } // namespace -namespace chromeos { +namespace ash { namespace full_restore { ArcAppLaunchHandler::ArcAppLaunchHandler() { @@ -747,4 +747,4 @@ void ArcAppLaunchHandler::RecordArcGhostWindowLaunch(bool is_arc_ghost_window) { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/arc_app_launch_handler.h b/chrome/browser/ash/full_restore/arc_app_launch_handler.h index 958a216433f93..a5035f1d545f8 100644 --- a/chrome/browser/ash/full_restore/arc_app_launch_handler.h +++ b/chrome/browser/ash/full_restore/arc_app_launch_handler.h @@ -27,7 +27,7 @@ namespace apps { class AppUpdate; } // namespace apps -namespace chromeos { +namespace ash { namespace full_restore { class ArcAppLaunchHandlerArcAppBrowserTest; @@ -234,7 +234,8 @@ class ArcAppLaunchHandler : public apps::AppRegistryCache::Observer, bool should_apply_cpu_restirction_ = false; - mojo::Remote probe_service_; + mojo::Remote + probe_service_; // Cpu usage rate count window. It save the cpu usage in a time interval. std::list cpu_tick_window_; @@ -253,6 +254,6 @@ class ArcAppLaunchHandler : public apps::AppRegistryCache::Observer, }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_ARC_APP_LAUNCH_HANDLER_H_ diff --git a/chrome/browser/ash/full_restore/arc_ghost_window_delegate.cc b/chrome/browser/ash/full_restore/arc_ghost_window_delegate.cc index 0c11a536929a3..efb191c0eaa47 100644 --- a/chrome/browser/ash/full_restore/arc_ghost_window_delegate.cc +++ b/chrome/browser/ash/full_restore/arc_ghost_window_delegate.cc @@ -10,14 +10,14 @@ namespace { const int kNullWindowState = -1; -} +} // namespace -namespace chromeos { +namespace ash { namespace full_restore { ArcGhostWindowDelegate::ArcGhostWindowDelegate( exo::ClientControlledShellSurface* shell_surface, - chromeos::full_restore::ArcWindowHandler* handler, + ArcWindowHandler* handler, int window_id, int64_t display_id, gfx::Rect bounds) @@ -169,4 +169,4 @@ void ArcGhostWindowDelegate::UpdateWindowInfoToArc() { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/arc_ghost_window_delegate.h b/chrome/browser/ash/full_restore/arc_ghost_window_delegate.h index dd061dc74946b..7aae3a1920b69 100644 --- a/chrome/browser/ash/full_restore/arc_ghost_window_delegate.h +++ b/chrome/browser/ash/full_restore/arc_ghost_window_delegate.h @@ -10,7 +10,7 @@ #include "components/exo/client_controlled_shell_surface.h" #include "ui/gfx/geometry/rect.h" -namespace chromeos { +namespace ash { namespace full_restore { // The ArcGhostWindowDelegate class is a self controlled shell surface delegate @@ -18,10 +18,10 @@ namespace full_restore { // changed, notify ARC. class ArcGhostWindowDelegate : public exo::ClientControlledShellSurface::Delegate, - public chromeos::full_restore::ArcWindowHandler::Observer { + public ArcWindowHandler::Observer { public: ArcGhostWindowDelegate(exo::ClientControlledShellSurface* shell_surface, - chromeos::full_restore::ArcWindowHandler* handler, + ArcWindowHandler* handler, int window_id, int64_t display_id, gfx::Rect bounds); @@ -64,12 +64,11 @@ class ArcGhostWindowDelegate exo::ClientControlledShellSurface* shell_surface_; ArcWindowHandler* arc_handler_; - base::ScopedObservation + base::ScopedObservation observation_{this}; }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_ARC_GHOST_WINDOW_DELEGATE_H_ diff --git a/chrome/browser/ash/full_restore/arc_ghost_window_shell_surface.cc b/chrome/browser/ash/full_restore/arc_ghost_window_shell_surface.cc index f37620b3e3a61..868306ef38823 100644 --- a/chrome/browser/ash/full_restore/arc_ghost_window_shell_surface.cc +++ b/chrome/browser/ash/full_restore/arc_ghost_window_shell_surface.cc @@ -16,12 +16,10 @@ #include "ui/views/window/caption_button_types.h" namespace { - constexpr int kDiameter = 24; - } // namespace -namespace chromeos { +namespace ash { namespace full_restore { std::unique_ptr InitArcGhostWindow( @@ -155,4 +153,4 @@ void ArcGhostWindowShellSurface::SetShellAppId( } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/arc_ghost_window_shell_surface.h b/chrome/browser/ash/full_restore/arc_ghost_window_shell_surface.h index 8a258a77e3034..bf1fbc7c1f960 100644 --- a/chrome/browser/ash/full_restore/arc_ghost_window_shell_surface.h +++ b/chrome/browser/ash/full_restore/arc_ghost_window_shell_surface.h @@ -10,7 +10,7 @@ #include "components/exo/client_controlled_shell_surface.h" #include "ui/gfx/geometry/rect.h" -namespace chromeos { +namespace ash { namespace full_restore { class ArcWindowHandler; @@ -58,6 +58,6 @@ class ArcGhostWindowShellSurface : public exo::ClientControlledShellSurface { }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_ARC_GHOST_WINDOW_SHELL_SURFACE_H_ diff --git a/chrome/browser/ash/full_restore/arc_ghost_window_view.cc b/chrome/browser/ash/full_restore/arc_ghost_window_view.cc index 68d7d801386ea..4f8f8f51d60a3 100644 --- a/chrome/browser/ash/full_restore/arc_ghost_window_view.cc +++ b/chrome/browser/ash/full_restore/arc_ghost_window_view.cc @@ -55,7 +55,7 @@ class Throbber : public views::View { } // namespace -namespace chromeos { +namespace ash { namespace full_restore { ArcGhostWindowView::ArcGhostWindowView(int throbber_diameter, @@ -88,7 +88,7 @@ void ArcGhostWindowView::InitLayout(uint32_t theme_color, int diameter) { } void ArcGhostWindowView::LoadIcon(const std::string& app_id) { - Profile* profile = chromeos::ProfileHelper::Get()->GetProfileByAccountId( + Profile* profile = ProfileHelper::Get()->GetProfileByAccountId( user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId()); DCHECK(profile); @@ -120,4 +120,4 @@ void ArcGhostWindowView::OnIconLoaded(apps::mojom::IconType icon_type, } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/arc_ghost_window_view.h b/chrome/browser/ash/full_restore/arc_ghost_window_view.h index 018c6d0d4a1dc..6f7a99101ca7f 100644 --- a/chrome/browser/ash/full_restore/arc_ghost_window_view.h +++ b/chrome/browser/ash/full_restore/arc_ghost_window_view.h @@ -11,9 +11,9 @@ namespace views { class ImageView; -} +} // namespace views -namespace chromeos { +namespace ash { namespace full_restore { // The view of ARC ghost window content. It shows the icon of app and a @@ -43,6 +43,6 @@ class ArcGhostWindowView : public views::View { }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_ARC_GHOST_WINDOW_VIEW_H_ diff --git a/chrome/browser/ash/full_restore/arc_ghost_window_view_unittest.cc b/chrome/browser/ash/full_restore/arc_ghost_window_view_unittest.cc index 5ea3d46e88173..1e9b689d5bb75 100644 --- a/chrome/browser/ash/full_restore/arc_ghost_window_view_unittest.cc +++ b/chrome/browser/ash/full_restore/arc_ghost_window_view_unittest.cc @@ -25,7 +25,7 @@ #include "ui/views/test/scoped_views_test_helper.h" #include "ui/views/test/views_test_base.h" -namespace chromeos { +namespace ash { namespace full_restore { namespace { @@ -128,4 +128,4 @@ TEST_F(ArcGhostWindowViewTest, IconLoadTest) { #endif } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/arc_window_handler.cc b/chrome/browser/ash/full_restore/arc_window_handler.cc index 2a6b2314b3eea..5ddc509d59811 100644 --- a/chrome/browser/ash/full_restore/arc_window_handler.cc +++ b/chrome/browser/ash/full_restore/arc_window_handler.cc @@ -14,7 +14,7 @@ #include "components/full_restore/full_restore_utils.h" #include "ui/views/window/caption_button_layout_constants.h" -namespace chromeos { +namespace ash { namespace full_restore { ArcWindowHandler::WindowSessionResolver::WindowSessionResolver( @@ -142,4 +142,4 @@ void ArcWindowHandler::OnWindowInfoUpdated(int window_id, } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/arc_window_handler.h b/chrome/browser/ash/full_restore/arc_window_handler.h index 32afe58781884..bed9ec5cfe752 100644 --- a/chrome/browser/ash/full_restore/arc_window_handler.h +++ b/chrome/browser/ash/full_restore/arc_window_handler.h @@ -14,9 +14,9 @@ namespace full_restore { struct AppRestoreData; -} +} // namespace full_restore -namespace chromeos { +namespace ash { namespace full_restore { // The ArcWindowHandler class provides control for ARC ghost window. @@ -98,6 +98,6 @@ class ArcWindowHandler { }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_ARC_WINDOW_HANDLER_H_ diff --git a/chrome/browser/ash/full_restore/arc_window_utils.cc b/chrome/browser/ash/full_restore/arc_window_utils.cc index cdcb326623365..702e4d5eb9123 100644 --- a/chrome/browser/ash/full_restore/arc_window_utils.cc +++ b/chrome/browser/ash/full_restore/arc_window_utils.cc @@ -27,7 +27,7 @@ void ScaleToRoundedRect(apps::mojom::Rect* rect, double scale_factor) { } // namespace -namespace chromeos { +namespace ash { namespace full_restore { bool IsArcGhostWindowEnabled() { @@ -75,4 +75,4 @@ const std::string WindowIdToAppId(int window_id) { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/arc_window_utils.h b/chrome/browser/ash/full_restore/arc_window_utils.h index 19b2d5232ee5e..a1a2a3f656aea 100644 --- a/chrome/browser/ash/full_restore/arc_window_utils.h +++ b/chrome/browser/ash/full_restore/arc_window_utils.h @@ -8,7 +8,7 @@ #include "components/services/app_service/public/mojom/types.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { +namespace ash { namespace full_restore { absl::optional GetDisplayScaleFactor(int64_t display_id); @@ -34,6 +34,6 @@ bool IsValidThemeColor(uint32_t theme_color); const std::string WindowIdToAppId(int window_id); } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_ARC_WINDOW_UTILS_H_ diff --git a/chrome/browser/ash/full_restore/arc_window_utils_unittest.cc b/chrome/browser/ash/full_restore/arc_window_utils_unittest.cc index daca3a8a10fb6..67d6fe63f3a0d 100644 --- a/chrome/browser/ash/full_restore/arc_window_utils_unittest.cc +++ b/chrome/browser/ash/full_restore/arc_window_utils_unittest.cc @@ -19,7 +19,7 @@ const int TEST_DISPLAY_HEIGHT = 1440; const double TEST_SCALE_FACTOR = 2.0; } // namespace -namespace chromeos { +namespace ash { namespace full_restore { class ArcWindowUtilsTest : public testing::Test { @@ -97,4 +97,4 @@ TEST_F(ArcWindowUtilsTest, ArcWindowInfoValidDisplayAndBoundsTest) { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_app_launch_handler.cc b/chrome/browser/ash/full_restore/full_restore_app_launch_handler.cc index a3f0c71367bfa..d18c8a248cabb 100644 --- a/chrome/browser/ash/full_restore/full_restore_app_launch_handler.cc +++ b/chrome/browser/ash/full_restore/full_restore_app_launch_handler.cc @@ -27,7 +27,7 @@ #include "components/full_restore/full_restore_save_handler.h" #include "extensions/common/constants.h" -namespace chromeos { +namespace ash { namespace full_restore { namespace { @@ -55,7 +55,7 @@ FullRestoreAppLaunchHandler::~FullRestoreAppLaunchHandler() = default; void FullRestoreAppLaunchHandler::LaunchBrowserWhenReady() { if (g_launch_browser_for_testing || base::CommandLine::ForCurrentProcess()->HasSwitch( - chromeos::switches::kForceLaunchBrowser)) { + switches::kForceLaunchBrowser)) { ForceLaunchBrowserForTesting(); return; } @@ -224,4 +224,4 @@ ScopedLaunchBrowserForTesting::~ScopedLaunchBrowserForTesting() { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_app_launch_handler.h b/chrome/browser/ash/full_restore/full_restore_app_launch_handler.h index 9d02d3c399161..2ff20a506711a 100644 --- a/chrome/browser/ash/full_restore/full_restore_app_launch_handler.h +++ b/chrome/browser/ash/full_restore/full_restore_app_launch_handler.h @@ -19,7 +19,7 @@ enum class AppTypeName; class Profile; -namespace chromeos { +namespace ash { namespace full_restore { // The FullRestoreAppLaunchHandler class calls FullRestoreReadHandler to read @@ -111,6 +111,6 @@ class ScopedLaunchBrowserForTesting { }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_FULL_RESTORE_APP_LAUNCH_HANDLER_H_ diff --git a/chrome/browser/ash/full_restore/full_restore_app_launch_handler_browsertest.cc b/chrome/browser/ash/full_restore/full_restore_app_launch_handler_browsertest.cc index 5b62e0bf15286..9e602f8198719 100644 --- a/chrome/browser/ash/full_restore/full_restore_app_launch_handler_browsertest.cc +++ b/chrome/browser/ash/full_restore/full_restore_app_launch_handler_browsertest.cc @@ -86,7 +86,7 @@ struct TypeConverter()); + std::make_unique()); } ~FullRestoreAppLaunchHandlerChromeAppBrowserTest() override = default; }; @@ -2473,7 +2472,8 @@ IN_PROC_BROWSER_TEST_P(FullRestoreAppLaunchHandlerSystemWebAppsBrowserTest, auto* window_state = ash::WindowState::Get(window); const ash::WMEvent left_snap_event(ash::WM_EVENT_SNAP_PRIMARY); window_state->OnWMEvent(&left_snap_event); - const WindowStateType pre_save_state_type = window_state->GetStateType(); + const chromeos::WindowStateType pre_save_state_type = + window_state->GetStateType(); EXPECT_EQ(chromeos::WindowStateType::kPrimarySnapped, pre_save_state_type); const gfx::Rect pre_save_bounds = window->GetBoundsInScreen(); @@ -2585,4 +2585,4 @@ INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_REGULAR_PROFILE_P( FullRestoreAppLaunchHandlerSystemWebAppsBrowserTest); } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_arc_task_handler.cc b/chrome/browser/ash/full_restore/full_restore_arc_task_handler.cc index 6f2d28c6417af..e65355d623428 100644 --- a/chrome/browser/ash/full_restore/full_restore_arc_task_handler.cc +++ b/chrome/browser/ash/full_restore/full_restore_arc_task_handler.cc @@ -12,7 +12,7 @@ #include "chrome/browser/profiles/profile.h" #include "components/full_restore/full_restore_utils.h" -namespace chromeos { +namespace ash { namespace full_restore { // static @@ -101,4 +101,4 @@ void FullRestoreArcTaskHandler::Shutdown() { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_arc_task_handler.h b/chrome/browser/ash/full_restore/full_restore_arc_task_handler.h index 20967f8037e28..844b59c3e3f35 100644 --- a/chrome/browser/ash/full_restore/full_restore_arc_task_handler.h +++ b/chrome/browser/ash/full_restore/full_restore_arc_task_handler.h @@ -15,7 +15,7 @@ class Profile; -namespace chromeos { +namespace ash { namespace full_restore { class ArcAppLaunchHandler; @@ -84,6 +84,6 @@ class FullRestoreArcTaskHandler : public KeyedService, }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_FULL_RESTORE_ARC_TASK_HANDLER_H_ diff --git a/chrome/browser/ash/full_restore/full_restore_arc_task_handler_factory.cc b/chrome/browser/ash/full_restore/full_restore_arc_task_handler_factory.cc index e188cd6b5a151..8a8506e45d4a8 100644 --- a/chrome/browser/ash/full_restore/full_restore_arc_task_handler_factory.cc +++ b/chrome/browser/ash/full_restore/full_restore_arc_task_handler_factory.cc @@ -12,7 +12,7 @@ #include "components/full_restore/features.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" -namespace chromeos { +namespace ash { namespace full_restore { // static @@ -49,4 +49,4 @@ KeyedService* FullRestoreArcTaskHandlerFactory::BuildServiceInstanceFor( } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_arc_task_handler_factory.h b/chrome/browser/ash/full_restore/full_restore_arc_task_handler_factory.h index d8abdf4e131f1..21b7160ee8f74 100644 --- a/chrome/browser/ash/full_restore/full_restore_arc_task_handler_factory.h +++ b/chrome/browser/ash/full_restore/full_restore_arc_task_handler_factory.h @@ -10,7 +10,7 @@ class Profile; -namespace chromeos { +namespace ash { namespace full_restore { class FullRestoreArcTaskHandler; @@ -38,6 +38,6 @@ class FullRestoreArcTaskHandlerFactory }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_FULL_RESTORE_ARC_TASK_HANDLER_FACTORY_H_ diff --git a/chrome/browser/ash/full_restore/full_restore_data_handler.cc b/chrome/browser/ash/full_restore/full_restore_data_handler.cc index 1ec9a8d1d02b6..02c008a835020 100644 --- a/chrome/browser/ash/full_restore/full_restore_data_handler.cc +++ b/chrome/browser/ash/full_restore/full_restore_data_handler.cc @@ -12,7 +12,7 @@ #include "components/services/app_service/public/cpp/app_update.h" #include "components/services/app_service/public/cpp/types_util.h" -namespace chromeos { +namespace ash { namespace full_restore { FullRestoreDataHandler::FullRestoreDataHandler(Profile* profile) @@ -47,4 +47,4 @@ void FullRestoreDataHandler::OnAppRegistryCacheWillBeDestroyed( } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_data_handler.h b/chrome/browser/ash/full_restore/full_restore_data_handler.h index 3100d12acc5f7..6b4557566a3f2 100644 --- a/chrome/browser/ash/full_restore/full_restore_data_handler.h +++ b/chrome/browser/ash/full_restore/full_restore_data_handler.h @@ -9,7 +9,7 @@ class Profile; -namespace chromeos { +namespace ash { namespace full_restore { // The FullRestoreDataHandler class observes AppRegistryCache to remove the app @@ -34,6 +34,6 @@ class FullRestoreDataHandler : public apps::AppRegistryCache::Observer { }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_FULL_RESTORE_DATA_HANDLER_H_ diff --git a/chrome/browser/ash/full_restore/full_restore_prefs.cc b/chrome/browser/ash/full_restore/full_restore_prefs.cc index 5b7aa022dfa6e..300e2519a3b27 100644 --- a/chrome/browser/ash/full_restore/full_restore_prefs.cc +++ b/chrome/browser/ash/full_restore/full_restore_prefs.cc @@ -11,7 +11,7 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" -namespace chromeos { +namespace ash { namespace full_restore { // An integer pref to define whether restore apps and web pages on startup. @@ -82,4 +82,4 @@ void UpdateRestorePrefIfNecessary(PrefService* prefs) { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_prefs.h b/chrome/browser/ash/full_restore/full_restore_prefs.h index f39f1752fb67f..324bc8bb1d0bc 100644 --- a/chrome/browser/ash/full_restore/full_restore_prefs.h +++ b/chrome/browser/ash/full_restore/full_restore_prefs.h @@ -8,7 +8,7 @@ class PrefRegistrySimple; class PrefService; -namespace chromeos { +namespace ash { namespace full_restore { // Enum that specifies restore options on startup. The values must not be @@ -57,6 +57,6 @@ void SetDefaultRestorePrefIfNecessary(PrefService* prefs); void UpdateRestorePrefIfNecessary(PrefService* prefs); } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_FULL_RESTORE_PREFS_H_ diff --git a/chrome/browser/ash/full_restore/full_restore_prefs_unittest.cc b/chrome/browser/ash/full_restore/full_restore_prefs_unittest.cc index 8e527bb78bad7..ead1eaa089dde 100644 --- a/chrome/browser/ash/full_restore/full_restore_prefs_unittest.cc +++ b/chrome/browser/ash/full_restore/full_restore_prefs_unittest.cc @@ -16,7 +16,7 @@ #include "components/user_manager/scoped_user_manager.h" #include "testing/gtest/include/gtest/gtest.h" -namespace chromeos { +namespace ash { namespace full_restore { // Unit tests for full_restore_prefs. @@ -130,4 +130,4 @@ TEST_F(FullRestorePrefsTest, NewChromeOSUserFromNotRestore) { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_service.cc b/chrome/browser/ash/full_restore/full_restore_service.cc index 7ca4de318e9ee..18618dc107388 100644 --- a/chrome/browser/ash/full_restore/full_restore_service.cc +++ b/chrome/browser/ash/full_restore/full_restore_service.cc @@ -33,7 +33,7 @@ #include "ui/chromeos/devicetype_utils.h" #include "ui/message_center/public/cpp/notification.h" -namespace chromeos { +namespace ash { namespace full_restore { bool g_restore_for_testing = true; @@ -83,7 +83,7 @@ void FullRestoreService::Init() { weak_ptr_factory_.GetWeakPtr())); const user_manager::User* user = - chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); + ProfileHelper::Get()->GetUserByProfile(profile_); if (user) { ::full_restore::FullRestoreInfo::GetInstance()->SetRestorePref( user->GetAccountId(), CanPerformRestore(prefs)); @@ -242,7 +242,7 @@ void FullRestoreService::MaybeShowRestoreNotification(const std::string& id) { void FullRestoreService::Restore() { const user_manager::User* user = - chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); + ProfileHelper::Get()->GetUserByProfile(profile_); if (user) { ::full_restore::FullRestoreInfo::GetInstance()->SetRestoreFlag( user->GetAccountId(), true); @@ -267,7 +267,7 @@ void FullRestoreService::OnPreferenceChanged(const std::string& pref_name) { base::UmaHistogramEnumeration(kRestoreSettingHistogramName, restore_option); const user_manager::User* user = - chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); + ProfileHelper::Get()->GetUserByProfile(profile_); if (user) { ::full_restore::FullRestoreInfo::GetInstance()->SetRestorePref( user->GetAccountId(), CanPerformRestore(profile_->GetPrefs())); @@ -294,4 +294,4 @@ ScopedRestoreForTesting::~ScopedRestoreForTesting() { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_service.h b/chrome/browser/ash/full_restore/full_restore_service.h index 1f476d132024a..e4ffd3de6f089 100644 --- a/chrome/browser/ash/full_restore/full_restore_service.h +++ b/chrome/browser/ash/full_restore/full_restore_service.h @@ -19,9 +19,9 @@ class Profile; namespace message_center { class Notification; -} +} // namespace message_center -namespace chromeos { +namespace ash { namespace full_restore { class FullRestoreAppLaunchHandler; @@ -143,14 +143,6 @@ class ScopedRestoreForTesting { }; } // namespace full_restore -} // namespace chromeos - -// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos -// source migration is finished. -namespace ash { -namespace full_restore { -using ::chromeos::full_restore::FullRestoreService; -} } // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_FULL_RESTORE_SERVICE_H_ diff --git a/chrome/browser/ash/full_restore/full_restore_service_factory.cc b/chrome/browser/ash/full_restore/full_restore_service_factory.cc index b17dc731974d6..ff25db274e1a5 100644 --- a/chrome/browser/ash/full_restore/full_restore_service_factory.cc +++ b/chrome/browser/ash/full_restore/full_restore_service_factory.cc @@ -13,7 +13,7 @@ #include "components/full_restore/features.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" -namespace chromeos { +namespace ash { namespace full_restore { // static @@ -67,4 +67,4 @@ KeyedService* FullRestoreServiceFactory::BuildServiceInstanceFor( } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/full_restore_service_factory.h b/chrome/browser/ash/full_restore/full_restore_service_factory.h index 3c1e1a0422443..0c00ef5ac55ee 100644 --- a/chrome/browser/ash/full_restore/full_restore_service_factory.h +++ b/chrome/browser/ash/full_restore/full_restore_service_factory.h @@ -11,9 +11,9 @@ namespace content { class BrowserContext; -} +} // namespace content -namespace chromeos { +namespace ash { namespace full_restore { // Singleton factory that builds and owns FullRestoreService. @@ -40,6 +40,13 @@ class FullRestoreServiceFactory : public BrowserContextKeyedServiceFactory { content::BrowserContext* context) const override; }; +} // namespace full_restore +} // namespace ash + +// TODO(https://crbug.com/1164001): remove when ChromeOS code migration is done. +namespace chromeos { +namespace full_restore { +using ::ash::full_restore::FullRestoreServiceFactory; } // namespace full_restore } // namespace chromeos diff --git a/chrome/browser/ash/full_restore/full_restore_service_unittest.cc b/chrome/browser/ash/full_restore/full_restore_service_unittest.cc index f645876090afe..bef9f820fc375 100644 --- a/chrome/browser/ash/full_restore/full_restore_service_unittest.cc +++ b/chrome/browser/ash/full_restore/full_restore_service_unittest.cc @@ -45,7 +45,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/message_center/public/cpp/notification.h" -namespace chromeos { +namespace ash { namespace full_restore { namespace { @@ -579,4 +579,4 @@ TEST_F(FullRestoreServiceTest, NotRestore) { } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/new_user_restore_pref_handler.cc b/chrome/browser/ash/full_restore/new_user_restore_pref_handler.cc index bc8dbd1d1c3cb..1b2cc07f19e0d 100644 --- a/chrome/browser/ash/full_restore/new_user_restore_pref_handler.cc +++ b/chrome/browser/ash/full_restore/new_user_restore_pref_handler.cc @@ -10,7 +10,7 @@ #include "chrome/browser/prefs/pref_service_syncable_util.h" #include "chrome/browser/profiles/profile.h" -namespace chromeos { +namespace ash { namespace full_restore { NewUserRestorePrefHandler::NewUserRestorePrefHandler(Profile* profile) @@ -46,7 +46,7 @@ void NewUserRestorePrefHandler::OnStartedSyncing(const std::string& path) { void NewUserRestorePrefHandler::OnIsSyncingChanged() { // Wait until the initial sync happens. auto* pref_service = PrefServiceSyncableFromProfile(profile_); - bool is_syncing = chromeos::features::IsSplitSettingsSyncEnabled() + bool is_syncing = features::IsSplitSettingsSyncEnabled() ? pref_service->AreOsPrefsSyncing() : pref_service->IsSyncing(); if (!is_syncing) @@ -77,4 +77,4 @@ void NewUserRestorePrefHandler::OnPreferenceChanged( } } // namespace full_restore -} // namespace chromeos +} // namespace ash diff --git a/chrome/browser/ash/full_restore/new_user_restore_pref_handler.h b/chrome/browser/ash/full_restore/new_user_restore_pref_handler.h index 8abae79cf170b..9f95ee91e5da4 100644 --- a/chrome/browser/ash/full_restore/new_user_restore_pref_handler.h +++ b/chrome/browser/ash/full_restore/new_user_restore_pref_handler.h @@ -14,7 +14,7 @@ class Profile; -namespace chromeos { +namespace ash { namespace full_restore { // This class handles the new user's OS restore pref "restore_apps_and_pages". @@ -70,6 +70,6 @@ class NewUserRestorePrefHandler }; } // namespace full_restore -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_FULL_RESTORE_NEW_USER_RESTORE_PREF_HANDLER_H_ diff --git a/chrome/browser/chromeos/browser_context_keyed_service_factories.cc b/chrome/browser/chromeos/browser_context_keyed_service_factories.cc index e9f5bffa73302..631c08c9eb983 100644 --- a/chrome/browser/chromeos/browser_context_keyed_service_factories.cc +++ b/chrome/browser/chromeos/browser_context_keyed_service_factories.cc @@ -65,7 +65,7 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() { bluetooth::DebugLogsManagerFactory::GetInstance(); borealis::BorealisServiceFactory::GetInstance(); cert_provisioning::CertProvisioningSchedulerUserServiceFactory::GetInstance(); - chromeos::full_restore::FullRestoreServiceFactory::GetInstance(); + ash::full_restore::FullRestoreServiceFactory::GetInstance(); CroshLoaderFactory::GetInstance(); crostini::CrostiniEngagementMetricsService::Factory::GetInstance(); #if defined(USE_CUPS) diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc index a0eb208c314d1..26106dc469667 100644 --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc @@ -665,7 +665,7 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() { settings_api::PrefType::PREF_TYPE_BOOLEAN; // Restore apps and pages on startup - (*s_allowlist)[chromeos::full_restore::kRestoreAppsAndPagesPrefName] = + (*s_allowlist)[ash::full_restore::kRestoreAppsAndPagesPrefName] = settings_api::PrefType::PREF_TYPE_NUMBER; // Timezone settings. diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index d3be33ed5602e..8a4988281776b 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -1283,7 +1283,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, chromeos::InlineLoginHandlerChromeOS::RegisterProfilePrefs(registry); ash::first_run::RegisterProfilePrefs(registry); ash::file_system_provider::RegisterProfilePrefs(registry); - chromeos::full_restore::RegisterProfilePrefs(registry); + ash::full_restore::RegisterProfilePrefs(registry); ash::KerberosCredentialsManager::RegisterProfilePrefs(registry); chromeos::login::SecurityTokenSessionController::RegisterProfilePrefs( registry); diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index 0eb3948eaeadb..4e3e7464ac175 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc @@ -349,7 +349,7 @@ base::FilePath ChromeShellDelegate::GetPrimaryUserDownloadsFolder() const { return base::FilePath(); } -std::unique_ptr +std::unique_ptr<::full_restore::AppLaunchInfo> ChromeShellDelegate::GetAppLaunchDataForDeskTemplate( aura::Window* window) const { const user_manager::User* active_user = diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.h b/chrome/browser/ui/ash/chrome_shell_delegate.h index a197fddf1dfdc..0abf38c6b651b 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.h +++ b/chrome/browser/ui/ash/chrome_shell_delegate.h @@ -53,8 +53,8 @@ class ChromeShellDelegate : public ash::ShellDelegate { bool IsLoggingRedirectDisabled() const override; base::FilePath GetPrimaryUserDownloadsFolder() const override; void OpenFeedbackPageForPersistentDesksBar() override; - std::unique_ptr GetAppLaunchDataForDeskTemplate( - aura::Window* window) const override; + std::unique_ptr<::full_restore::AppLaunchInfo> + GetAppLaunchDataForDeskTemplate(aura::Window* window) const override; static void SetDisableLoggingRedirectForTesting(bool value); static void ResetDisableLoggingRedirectForTesting(); diff --git a/chrome/browser/ui/ash/desk_template_app_launch_handler.cc b/chrome/browser/ui/ash/desk_template_app_launch_handler.cc index 43810e775a218..5bdb957e58f6b 100644 --- a/chrome/browser/ui/ash/desk_template_app_launch_handler.cc +++ b/chrome/browser/ui/ash/desk_template_app_launch_handler.cc @@ -27,7 +27,7 @@ constexpr base::TimeDelta kClearRestoreDataDuration = } // namespace DeskTemplateAppLaunchHandler::DeskTemplateAppLaunchHandler(Profile* profile) - : chromeos::AppLaunchHandler(profile) { + : ash::AppLaunchHandler(profile) { full_restore::DeskTemplateReadHandler::GetInstance()->SetDelegate(this); } @@ -88,11 +88,11 @@ int32_t DeskTemplateAppLaunchHandler::FetchRestoreWindowId( } bool DeskTemplateAppLaunchHandler::IsFullRestoreRunning() const { - chromeos::full_restore::FullRestoreService* full_restore_service = - chromeos::full_restore::FullRestoreService::GetForProfile(profile_); + ash::full_restore::FullRestoreService* full_restore_service = + ash::full_restore::FullRestoreService::GetForProfile(profile_); if (!full_restore_service) return false; - chromeos::full_restore::FullRestoreAppLaunchHandler* + ash::full_restore::FullRestoreAppLaunchHandler* full_restore_app_launch_handler = full_restore_service->app_launch_handler(); DCHECK(full_restore_app_launch_handler); @@ -115,7 +115,7 @@ void DeskTemplateAppLaunchHandler::OnExtensionLaunching( restore_data_clone_->SetNextRestoreWindowIdForChromeApp(app_id); } -base::WeakPtr +base::WeakPtr DeskTemplateAppLaunchHandler::GetWeakPtrAppLaunchHandler() { return weak_ptr_factory_.GetWeakPtr(); } diff --git a/chrome/browser/ui/ash/desk_template_app_launch_handler.h b/chrome/browser/ui/ash/desk_template_app_launch_handler.h index d2ceefdc77d56..1aed9659520cc 100644 --- a/chrome/browser/ui/ash/desk_template_app_launch_handler.h +++ b/chrome/browser/ui/ash/desk_template_app_launch_handler.h @@ -25,7 +25,7 @@ struct WindowInfo; // The DeskTemplateAppLaunchHandler class is passed in the desk template restore // data and profile, and will launch apps and web pages based on the template. class DeskTemplateAppLaunchHandler - : public chromeos::AppLaunchHandler, + : public ash::AppLaunchHandler, public full_restore::DeskTemplateReadHandler::Delegate { public: explicit DeskTemplateAppLaunchHandler(Profile* profile); @@ -48,8 +48,7 @@ class DeskTemplateAppLaunchHandler protected: // chromeos::AppLaunchHandler: void OnExtensionLaunching(const std::string& app_id) override; - base::WeakPtr GetWeakPtrAppLaunchHandler() - override; + base::WeakPtr GetWeakPtrAppLaunchHandler() override; private: // Go through the restore data launch list and launches the browser windows. diff --git a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_arc_tracker.cc b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_arc_tracker.cc index c98f980b14b3c..1af3da2d8e0e7 100644 --- a/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_arc_tracker.cc +++ b/chrome/browser/ui/ash/shelf/app_service/app_service_app_window_arc_tracker.cc @@ -61,7 +61,7 @@ AppServiceAppWindowArcTracker::AppServiceAppWindowArcTracker( arc_session_manager->AddObserver(this); auto* arc_handler = - chromeos::full_restore::FullRestoreArcTaskHandler::GetForProfile( + ash::full_restore::FullRestoreArcTaskHandler::GetForProfile( observed_profile_); if (arc_handler) arc_handler->OnShelfReady(); @@ -682,7 +682,7 @@ void AppServiceAppWindowArcTracker::OnSessionDestroyed(int32_t session_id) { // Close the ghost window. auto* arc_handler = - chromeos::full_restore::FullRestoreArcTaskHandler::GetForProfile( + ash::full_restore::FullRestoreArcTaskHandler::GetForProfile( observed_profile_); if (arc_handler && arc_handler->window_handler()) arc_handler->window_handler()->CloseWindow(session_id); diff --git a/chrome/browser/ui/ash/shelf/arc_shelf_spinner_item_controller.cc b/chrome/browser/ui/ash/shelf/arc_shelf_spinner_item_controller.cc index c1a85d7fd2d37..cba8d1bf210cc 100644 --- a/chrome/browser/ui/ash/shelf/arc_shelf_spinner_item_controller.cc +++ b/chrome/browser/ui/ash/shelf/arc_shelf_spinner_item_controller.cc @@ -55,7 +55,7 @@ void ArcShelfSpinnerItemController::ItemSelected( if (window_info_ && window_info_->window_id > full_restore::kArcSessionIdOffsetForRestoredLaunching) { - chromeos::full_restore::FullRestoreArcTaskHandler::GetForProfile( + ash::full_restore::FullRestoreArcTaskHandler::GetForProfile( observed_profile_) ->arc_app_launch_handler() ->LaunchApp(app_id()); @@ -103,7 +103,7 @@ void ArcShelfSpinnerItemController::OnAppConnectionReady() { // this item when timeout. if (IsCreatedByFullRestore() && !close_timer_) { close_timer_ = std::make_unique(); - close_timer_->Start(FROM_HERE, chromeos::full_restore::kStopRestoreDelay, + close_timer_->Start(FROM_HERE, ash::full_restore::kStopRestoreDelay, base::BindOnce(&ArcShelfSpinnerItemController::Close, weak_ptr_factory_.GetWeakPtr())); } diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc index 8de31d0348539..932b0b766ed95 100644 --- a/chrome/browser/ui/startup/startup_browser_creator.cc +++ b/chrome/browser/ui/startup/startup_browser_creator.cc @@ -688,7 +688,7 @@ bool StartupBrowserCreator::LaunchBrowserForLastProfiles( // restore feature is enabled and the profile is a regular user // profile), defer the browser launching to FullRestoreService code. auto* full_restore_service = - chromeos::full_restore::FullRestoreService::GetForProfile( + ash::full_restore::FullRestoreService::GetForProfile( profile_to_open); if (full_restore_service) { full_restore_service->LaunchBrowserWhenReady(); diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index af2496f694f8e..e2e3c2d3b4527 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc @@ -270,7 +270,7 @@ void InProcessBrowserTest::Initialize() { #if BUILDFLAG(IS_CHROMEOS_ASH) launch_browser_for_testing_ = - std::make_unique(); + std::make_unique(); #endif } diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h index afd0bcc53784c..d2861cdc2159e 100644 --- a/chrome/test/base/in_process_browser_test.h +++ b/chrome/test/base/in_process_browser_test.h @@ -291,7 +291,7 @@ class InProcessBrowserTest : public content::BrowserTestBase { #if BUILDFLAG(IS_CHROMEOS_ASH) void set_launch_browser_for_testing( - std::unique_ptr + std::unique_ptr launch_browser_for_testing) { launch_browser_for_testing_ = std::move(launch_browser_for_testing); } @@ -360,7 +360,7 @@ class InProcessBrowserTest : public content::BrowserTestBase { // is enabled. However almost all existing browser tests assume a browser is // created. Add ScopedLaunchBrowserForTesting to force creating a browser for // testing, when the full restore feature is enabled. - std::unique_ptr + std::unique_ptr launch_browser_for_testing_; #endif }; diff --git a/components/full_restore/full_restore_read_handler.h b/components/full_restore/full_restore_read_handler.h index 0111e3a509c54..b41499ad4474c 100644 --- a/components/full_restore/full_restore_read_handler.h +++ b/components/full_restore/full_restore_read_handler.h @@ -23,13 +23,13 @@ #include "ui/aura/window_observer.h" #include "ui/views/widget/widget.h" -namespace chromeos { +namespace ash { namespace full_restore { class FullRestoreAppLaunchHandlerBrowserTest; class FullRestoreAppLaunchHandlerSystemWebAppsBrowserTest; class FullRestoreServiceTestHavingFullRestoreFile; -} -} +} // namespace full_restore +} // namespace ash namespace full_restore { @@ -152,11 +152,10 @@ class COMPONENT_EXPORT(FULL_RESTORE) FullRestoreReadHandler private: friend class ArcReadHandler; - friend class ::chromeos::full_restore::FullRestoreAppLaunchHandlerBrowserTest; - friend class ::chromeos::full_restore:: + friend class ::ash::full_restore::FullRestoreAppLaunchHandlerBrowserTest; + friend class ::ash::full_restore:: FullRestoreAppLaunchHandlerSystemWebAppsBrowserTest; - friend class ::chromeos::full_restore:: - FullRestoreServiceTestHavingFullRestoreFile; + friend class ::ash::full_restore::FullRestoreServiceTestHavingFullRestoreFile; friend class FullRestoreReadHandlerTestApi; // Gets the app launch information from `profile_path` for `app_id` and