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

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

Issue 2039543002: Getting rid of ChromeLauncherController::model(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing git cl dependencies Created 4 years, 6 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/browser_shortcut_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc
index bd4c39734264403f68ea464a21c9e51614125aba..e57bac79e170cb3e2430b0778e6e6a6421bcad8e 100644
--- a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc
@@ -58,11 +58,12 @@ bool IsSettingsBrowser(Browser* browser) {
} // namespace
BrowserShortcutLauncherItemController::BrowserShortcutLauncherItemController(
- ChromeLauncherController* launcher_controller)
+ ChromeLauncherController* launcher_controller,
+ ash::ShelfModel* shelf_model)
: LauncherItemController(TYPE_SHORTCUT,
extension_misc::kChromeAppId,
- launcher_controller) {
-}
+ launcher_controller),
+ shelf_model_(shelf_model) {}
BrowserShortcutLauncherItemController::
~BrowserShortcutLauncherItemController() {
@@ -74,12 +75,11 @@ void BrowserShortcutLauncherItemController::UpdateBrowserItemState() {
if (!ash::Shell::HasInstance())
return;
- ash::ShelfModel* model = launcher_controller()->model();
-
// Determine the new browser's active state and change if necessary.
- int browser_index = model->GetItemIndexForType(ash::TYPE_BROWSER_SHORTCUT);
+ int browser_index =
+ shelf_model_->GetItemIndexForType(ash::TYPE_BROWSER_SHORTCUT);
DCHECK_GE(browser_index, 0);
- ash::ShelfItem browser_item = model->items()[browser_index];
+ ash::ShelfItem browser_item = shelf_model_->items()[browser_index];
ash::ShelfItemStatus browser_status = ash::STATUS_CLOSED;
aura::Window* window = ash::wm::GetActiveWindow();
@@ -115,7 +115,7 @@ void BrowserShortcutLauncherItemController::UpdateBrowserItemState() {
if (browser_status != browser_item.status) {
browser_item.status = browser_status;
- model->Set(browser_index, browser_item);
+ shelf_model_->Set(browser_index, browser_item);
}
}

Powered by Google App Engine
This is Rietveld 408576698