Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4551)

Unified Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2708353007: Remove ArcSessionManager::SetShelfDelegateForTesting. (Closed)
Patch Set: address comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/arc_session_manager.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc
index 6710fbe4782fc77a5560fe47c27f5dc8e98ddf27..64c3226a78515f5d6425631833b79d8d726f58c1 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -60,9 +60,6 @@ ArcSessionManager* g_arc_session_manager = nullptr;
// Skip creating UI in unit tests
bool g_disable_ui_for_testing = false;
-// Use specified ash::ShelfDelegate for unit tests.
-ash::ShelfDelegate* g_shelf_delegate_for_testing = nullptr;
-
// The Android management check is disabled by default, it's used only for
// testing.
bool g_enable_check_android_management_for_testing = false;
@@ -72,14 +69,6 @@ bool g_enable_check_android_management_for_testing = false;
// but present the UI to try again.
constexpr base::TimeDelta kArcSignInTimeout = base::TimeDelta::FromMinutes(5);
-ash::ShelfDelegate* GetShelfDelegate() {
- if (g_shelf_delegate_for_testing)
- return g_shelf_delegate_for_testing;
- if (ash::WmShell::HasInstance())
- return ash::WmShell::Get()->shelf_delegate();
- return nullptr;
-}
-
} // namespace
ArcSessionManager::ArcSessionManager(
@@ -149,12 +138,6 @@ void ArcSessionManager::DisableUIForTesting() {
}
// static
-void ArcSessionManager::SetShelfDelegateForTesting(
- ash::ShelfDelegate* shelf_delegate) {
- g_shelf_delegate_for_testing = shelf_delegate;
-}
-
-// static
void ArcSessionManager::EnableCheckAndroidManagementForTesting() {
g_enable_check_android_management_for_testing = true;
}
@@ -536,7 +519,9 @@ void ArcSessionManager::OnOptInPreferenceChanged() {
// Remove the pinned Play Store icon launcher in Shelf.
// This is only for non-Managed cases. In managed cases, it is expected
// to be "disabled" rather than "removed", so keep it here.
- ash::ShelfDelegate* shelf_delegate = GetShelfDelegate();
+ auto* shelf_delegate = ash::WmShell::HasInstance()
+ ? ash::WmShell::Get()->shelf_delegate()
+ : nullptr;
if (shelf_delegate)
shelf_delegate->UnpinAppWithID(ArcSupportHost::kHostAppId);
}

Powered by Google App Engine
This is Rietveld 408576698