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

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

Issue 2833173002: mash: Support ShelfModel access in Chrome. (Closed)
Patch Set: Refine init pattern; add AppList item in ShelfModel ctor. Created 3 years, 7 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_play_store_enabled_preference_handler.cc
diff --git a/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc b/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc
index 8aa0cae0b3a4daad18dc6f578dd7ab8cd1bab00e..e7de3ac2bdc096970c6c92b4632a87dc268bd367 100644
--- a/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc
+++ b/chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.cc
@@ -4,8 +4,6 @@
#include "chrome/browser/chromeos/arc/arc_play_store_enabled_preference_handler.h"
-#include "ash/shelf/shelf_model.h"
-#include "ash/shell.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
@@ -16,6 +14,7 @@
#include "chrome/browser/prefs/pref_service_syncable_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
+#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
#include "components/arc/arc_util.h"
@@ -82,7 +81,6 @@ void ArcPlayStoreEnabledPreferenceHandler::Start() {
void ArcPlayStoreEnabledPreferenceHandler::OnPreferenceChanged() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
const bool is_play_store_enabled = IsArcPlayStoreEnabledForProfile(profile_);
if (!IsArcPlayStoreEnabledPreferenceManagedForProfile(profile_)) {
// Update UMA only for non-Managed cases.
@@ -93,11 +91,9 @@ void ArcPlayStoreEnabledPreferenceHandler::OnPreferenceChanged() {
// 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.
- auto* shelf_model = ash::Shell::HasInstance()
- ? ash::Shell::Get()->shelf_model()
- : nullptr;
- if (shelf_model)
- shelf_model->UnpinAppWithID(kPlayStoreAppId);
+ auto* chrome_launcher_controller = ChromeLauncherController::instance();
+ if (chrome_launcher_controller)
+ chrome_launcher_controller->UnpinAppWithID(kPlayStoreAppId);
}
}

Powered by Google App Engine
This is Rietveld 408576698