| 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);
|
| }
|
|
|