Skip to content

Commit

Permalink
Change namespace chromeos => ash from //c/b/ash/app_mode
Browse files Browse the repository at this point in the history
Code in //chrome is not supposed to be in any namespace, but
chrome/browser/ash/ is really a part of the ash-chrome binary, and its
current placement is only a product of unwanted deps to
//chrome/browser.

To avoid having to make namespace changes twice, code that is or will be
eventually moved to namespace ash is changed to additionally export its
symbols in the older or newer namespace as needed.

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

Bug: 1164001
Change-Id: I0fdb482cfb85fb24d6ab11f3811431baf49f7998
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2648478
Owners-Override: James Cook <jamescook@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#849275}
  • Loading branch information
hferreiro authored and Chromium LUCI CQ committed Feb 1, 2021
1 parent 656a00c commit 26ed25a
Show file tree
Hide file tree
Showing 137 changed files with 590 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ using extensions::api::braille_display_private::KeyEvent;
using extensions::api::braille_display_private::MockBrailleController;
using testing::WithParamInterface;

namespace ash {

namespace {

// Use a real domain to avoid policy loading problems.
Expand Down Expand Up @@ -784,3 +786,5 @@ IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, BrailleWhenLoggedIn) {
EXPECT_TRUE(IsSpokenFeedbackEnabled());
EXPECT_TRUE(IsBrailleImeActive());
}

} // namespace ash
4 changes: 2 additions & 2 deletions chrome/browser/ash/app_mode/app_launch_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "components/prefs/pref_service.h"
#include "components/user_manager/user_manager.h"

namespace chromeos {
namespace ash {

namespace {

Expand Down Expand Up @@ -109,4 +109,4 @@ void SetEphemeralKioskPreferencesListForTesting(
test_prefs_to_reset = prefs;
}

} // namespace chromeos
} // namespace ash
10 changes: 8 additions & 2 deletions chrome/browser/ash/app_mode/app_launch_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class PrefService;
class Profile;

namespace chromeos {
namespace ash {

class KioskAppId;

Expand All @@ -25,6 +25,12 @@ void ResetEphemeralKioskPreferences(PrefService* prefs);
// Replace the list of preferences which are reset in tests.
void SetEphemeralKioskPreferencesListForTesting(std::vector<std::string>*);

} // namespace chromeos
} // namespace ash

// TODO(https://crbug.com/1164001): remove when the migration of
// //chrome/browser/ash is finished.
namespace chromeos {
using ::ash::LaunchAppOrDie;
}

#endif // CHROME_BROWSER_ASH_APP_MODE_APP_LAUNCH_UTILS_H_
12 changes: 8 additions & 4 deletions chrome/browser/ash/app_mode/app_launch_utils_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "components/user_manager/scoped_user_manager.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace ash {

namespace {

const char kEmptyPrefsFile[] = "{}";
Expand All @@ -27,10 +29,10 @@ class ScopedKioskPreferencesListForTesting {
explicit ScopedKioskPreferencesListForTesting(
const std::vector<std::string>& prefs_to_reset)
: prefs_(prefs_to_reset) {
chromeos::SetEphemeralKioskPreferencesListForTesting(&prefs_);
SetEphemeralKioskPreferencesListForTesting(&prefs_);
}
~ScopedKioskPreferencesListForTesting() {
chromeos::SetEphemeralKioskPreferencesListForTesting(nullptr);
SetEphemeralKioskPreferencesListForTesting(nullptr);
}

private:
Expand Down Expand Up @@ -92,7 +94,7 @@ TEST_F(AppLaunchUtilsTest, ClearUserPrefs) {
ScopedKioskPreferencesListForTesting prefs({pref_name});
pref_service->SetBoolean(pref_name, true);
pref_service->SetBoolean(pref2_name, true);
chromeos::ResetEphemeralKioskPreferences(pref_service.get());
ResetEphemeralKioskPreferences(pref_service.get());
EXPECT_FALSE(pref_service->GetBoolean(pref_name));
EXPECT_TRUE(pref_service->GetBoolean(pref2_name));
}
Expand All @@ -110,7 +112,9 @@ TEST_F(AppLaunchUtilsTest, ClearSubPrefs) {
pref_service->SetBoolean(pref_a, true);
pref_service->SetBoolean(pref_b, true);

chromeos::ResetEphemeralKioskPreferences(pref_service.get());
ResetEphemeralKioskPreferences(pref_service.get());
EXPECT_FALSE(pref_service->GetBoolean(pref_a));
EXPECT_FALSE(pref_service->GetBoolean(pref_b));
}

} // namespace ash
10 changes: 5 additions & 5 deletions chrome/browser/ash/app_mode/app_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
using extensions::AppWindow;
using extensions::AppWindowRegistry;

namespace chromeos {
namespace ash {

namespace {

Expand All @@ -63,13 +63,13 @@ bool IsPepperPlugin(const base::FilePath& plugin_path) {
}

void RebootDevice() {
PowerManagerClient::Get()->RequestRestart(
chromeos::PowerManagerClient::Get()->RequestRestart(
power_manager::REQUEST_RESTART_OTHER, "kiosk app session");
}

void StartFloatingAccessibilityMenu() {
ash::AccessibilityController* accessibility_controller =
ash::AccessibilityController::Get();
AccessibilityController* accessibility_controller =
AccessibilityController::Get();
if (accessibility_controller)
accessibility_controller->ShowFloatingMenuIfEnabled();
}
Expand Down Expand Up @@ -358,4 +358,4 @@ void AppSession::OnPluginHung(const std::set<int>& hung_plugins) {
FROM_HERE, base::BindOnce(&DumpPluginProcessOnIOThread, hung_plugins));
}

} // namespace chromeos
} // namespace ash
10 changes: 8 additions & 2 deletions chrome/browser/ash/app_mode/app_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace extensions {
class AppWindow;
}

namespace chromeos {
namespace ash {

class KioskSessionPluginHandler;

Expand Down Expand Up @@ -86,6 +86,12 @@ class AppSession : public KioskSessionPluginHandlerDelegate {
DISALLOW_COPY_AND_ASSIGN(AppSession);
};

} // namespace chromeos
} // namespace ash

// TODO(https://crbug.com/1164001): remove when the migration of
// //chrome/browser/chromeos is finished.
namespace chromeos {
using ::ash::AppSession;
}

#endif // CHROME_BROWSER_ASH_APP_MODE_APP_SESSION_H_
6 changes: 4 additions & 2 deletions chrome/browser/ash/app_mode/app_session_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace chromeos {
namespace ash {

namespace {

using ::chromeos::FakePowerManagerClient;

constexpr char kPepperPluginName1[] = "pepper_plugin_name1";
constexpr char kPepperPluginName2[] = "pepper_plugin_name2";
constexpr char kBrowserPluginName[] = "browser_plugin_name";
Expand Down Expand Up @@ -147,4 +149,4 @@ TEST_F(AppSessionTest, OnPluginHung) {
delegate->OnPluginHung(std::set<int>());
}

} // namespace chromeos
} // namespace ash
4 changes: 2 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/browser/browser_thread.h"

namespace chromeos {
namespace ash {

ArcKioskAppData::ArcKioskAppData(const std::string& app_id,
const std::string& package_name,
Expand Down Expand Up @@ -77,4 +77,4 @@ void ArcKioskAppData::OnIconLoadFailure() {
// Do nothing
}

} // namespace chromeos
} // namespace ash
10 changes: 8 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "components/account_id/account_id.h"
#include "ui/gfx/image/image_skia.h"

namespace chromeos {
namespace ash {

// Fetches from Android side and caches ARC kiosk app data such as name and
// icon.
Expand Down Expand Up @@ -52,6 +52,12 @@ class ArcKioskAppData : public KioskAppDataBase {
DISALLOW_COPY_AND_ASSIGN(ArcKioskAppData);
};

} // namespace chromeos
} // namespace ash

// TODO(https://crbug.com/1164001): remove when the //chrome/browser/chromeos
// migration is finished.
namespace chromeos {
using ::ash::ArcKioskAppData;
}

#endif // CHROME_BROWSER_ASH_APP_MODE_ARC_ARC_KIOSK_APP_DATA_H_
4 changes: 2 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "ui/base/ui_base_features.h"
#include "ui/events/event_constants.h"

namespace chromeos {
namespace ash {

ArcKioskAppLauncher::ArcKioskAppLauncher(content::BrowserContext* context,
ArcAppListPrefs* prefs,
Expand Down Expand Up @@ -97,4 +97,4 @@ void ArcKioskAppLauncher::StopObserving() {
prefs_->RemoveObserver(this);
}

} // namespace chromeos
} // namespace ash
4 changes: 2 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_launcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"

namespace chromeos {
namespace ash {

// Starts Android app in kiosk mode.
// Keeps track of start progress and pins app window
Expand Down Expand Up @@ -68,6 +68,6 @@ class ArcKioskAppLauncher : public ArcAppListPrefs::Observer,
DISALLOW_COPY_AND_ASSIGN(ArcKioskAppLauncher);
};

} // namespace chromeos
} // namespace ash

#endif // CHROME_BROWSER_ASH_APP_MODE_ARC_ARC_KIOSK_APP_LAUNCHER_H_
5 changes: 3 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"

namespace chromeos {
namespace ash {

namespace {

Expand Down Expand Up @@ -192,4 +192,5 @@ void ArcKioskAppManager::UpdateAppsFromPolicy() {

NotifyKioskAppsChanged();
}
} // namespace chromeos

} // namespace ash
10 changes: 8 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class PrefRegistrySimple;

namespace chromeos {
namespace ash {

// Keeps track of Android apps that are to be launched in kiosk mode.
// For removed apps deletes appropriate cryptohome. The information about
Expand Down Expand Up @@ -72,6 +72,12 @@ class ArcKioskAppManager : public KioskAppManagerBase {
DISALLOW_COPY_AND_ASSIGN(ArcKioskAppManager);
};

} // namespace chromeos
} // namespace ash

// TODO(https://crbug.com/1164001): remove when the //chrome/browser/chromeos
// source code migration is finished.
namespace chromeos {
using ::ash::ArcKioskAppManager;
}

#endif // CHROME_BROWSER_ASH_APP_MODE_ARC_ARC_KIOSK_APP_MANAGER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "content/public/test/browser_test.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace chromeos {
namespace ash {

namespace {

Expand Down Expand Up @@ -285,4 +285,4 @@ IN_PROC_BROWSER_TEST_F(ArcKioskAppManagerTest, UpdateNameAndIcon) {
ASSERT_TRUE(app->icon().BackedBySameObjectAs(new_icon));
}

} // namespace chromeos
} // namespace ash
4 changes: 2 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "ui/display/display.h"
#include "ui/display/screen.h"

namespace chromeos {
namespace ash {

namespace {

Expand Down Expand Up @@ -264,4 +264,4 @@ void ArcKioskAppService::ContinueWithNetworkReady() {}
void ArcKioskAppService::RestartLauncher() {}
void ArcKioskAppService::LaunchApp() {}

} // namespace chromeos
} // namespace ash
10 changes: 8 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace content {
class BrowserContext;
} // namespace content

namespace chromeos {
namespace ash {

class ArcKioskAppManager;

Expand Down Expand Up @@ -125,6 +125,12 @@ class ArcKioskAppService : public KeyedService,
DISALLOW_COPY_AND_ASSIGN(ArcKioskAppService);
};

} // namespace chromeos
} // namespace ash

// TODO(https://crbug.com/1164001): remove when the //chrome/browser/chromeos
// source code migration is finished.
namespace chromeos {
using ::ash::ArcKioskAppService;
}

#endif // CHROME_BROWSER_ASH_APP_MODE_ARC_ARC_KIOSK_APP_SERVICE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"

namespace chromeos {
namespace ash {

// static
ArcKioskAppService* ArcKioskAppServiceFactory::GetForBrowserContext(
Expand Down Expand Up @@ -40,4 +40,4 @@ KeyedService* ArcKioskAppServiceFactory::BuildServiceInstanceFor(
return ArcKioskAppService::Create(profile);
}

} // namespace chromeos
} // namespace ash
10 changes: 8 additions & 2 deletions chrome/browser/ash/app_mode/arc/arc_kiosk_app_service_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"

namespace chromeos {
namespace ash {

class ArcKioskAppService;

Expand All @@ -36,6 +36,12 @@ class ArcKioskAppServiceFactory : public BrowserContextKeyedServiceFactory {
DISALLOW_COPY_AND_ASSIGN(ArcKioskAppServiceFactory);
};

} // namespace chromeos
} // namespace ash

// TODO(https://crbug.com/1164001): remove when the //chrome/browser/chromeos
// source code migration is finished.
namespace chromeos {
using ::ash::ArcKioskAppServiceFactory;
}

#endif // CHROME_BROWSER_ASH_APP_MODE_ARC_ARC_KIOSK_APP_SERVICE_FACTORY_H_
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/test/test_screen.h"

namespace chromeos {
namespace ash {

namespace {

Expand Down Expand Up @@ -259,4 +259,4 @@ TEST_F(ArcKioskAppServiceTest, AppLaunches) {
controller.WaitUntilWindowCreated();
}

} // namespace chromeos
} // namespace ash
4 changes: 2 additions & 2 deletions chrome/browser/ash/app_mode/certificate_manager_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const int kDefaultHeight = 480;

} // namespace

namespace chromeos {
namespace ash {

CertificateManagerDialog::CertificateManagerDialog(
Profile* profile,
Expand All @@ -46,4 +46,4 @@ void CertificateManagerDialog::GetDialogSize(gfx::Size* size) const {
size->SetSize(kDefaultWidth, kDefaultHeight);
}

} // namespace chromeos
} // namespace ash
Loading

0 comments on commit 26ed25a

Please sign in to comment.