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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 22429004: Refactor LauncherDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for OpenBrowserUsingShelfOnOhterDisplay fail Created 7 years, 4 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/ui/ash/launcher/chrome_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
index d734685ce48f4cafa77ff36111c4f652b157e05a..a072cacf397be4914bf7a2be4e218195c3d6b733 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -8,6 +8,7 @@
#include "ash/ash_switches.h"
#include "ash/launcher/launcher.h"
+#include "ash/launcher/launcher_item_delegate_manager.h"
#include "ash/launcher/launcher_model.h"
#include "ash/launcher/launcher_util.h"
#include "ash/root_window_controller.h"
@@ -243,6 +244,11 @@ ChromeLauncherController::ChromeLauncherController(
prefs::kShelfPreferences,
base::Bind(&ChromeLauncherController::SetShelfBehaviorsFromPrefs,
base::Unretained(this)));
+
+ // This check is needed for win7_aura. Without this, all tests in
+ // ChromeLauncherControllerTest will fail by win7_aura.
+ if (ash::Shell::HasInstance())
+ RegisterLauncherItemDelegate();
}
ChromeLauncherController::~ChromeLauncherController() {
@@ -1651,3 +1657,16 @@ ChromeLauncherController::MoveItemWithoutPinnedStateChangeNotification(
base::AutoReset<bool> auto_reset(&ignore_persist_pinned_state_change_, true);
model_->Move(source_index, target_index);
}
+
+void ChromeLauncherController::RegisterLauncherItemDelegate() {
+ // TODO(simon.hong81): Register LauncherItemDelegate when LauncherItemDelegate
+ // is created.
+ ash::LauncherItemDelegateManager* manager =
+ ash::Shell::GetInstance()->launcher_item_delegate_manager();
+ manager->RegisterLauncherItemDelegate(ash::TYPE_TABBED, this);
+ manager->RegisterLauncherItemDelegate(ash::TYPE_APP_PANEL, this);
+ manager->RegisterLauncherItemDelegate(ash::TYPE_APP_SHORTCUT, this);
+ manager->RegisterLauncherItemDelegate(ash::TYPE_BROWSER_SHORTCUT, this);
+ manager->RegisterLauncherItemDelegate(ash::TYPE_PLATFORM_APP, this);
+ manager->RegisterLauncherItemDelegate(ash::TYPE_WINDOWED_APP, this);
+}

Powered by Google App Engine
This is Rietveld 408576698