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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 controller_ = ChromeLauncherController::instance(); 191 controller_ = ChromeLauncherController::instance();
192 return extensions::PlatformAppBrowserTest::RunTestOnMainThreadLoop(); 192 return extensions::PlatformAppBrowserTest::RunTestOnMainThreadLoop();
193 } 193 }
194 194
195 ash::ShelfModel* shelf_model() { 195 ash::ShelfModel* shelf_model() {
196 return ash::test::ShellTestApi(ash::Shell::GetInstance()).shelf_model(); 196 return ash::test::ShellTestApi(ash::Shell::GetInstance()).shelf_model();
197 } 197 }
198 198
199 ash::ShelfID CreateAppShortcutLauncherItem(const std::string& name) { 199 ash::ShelfID CreateAppShortcutLauncherItem(const std::string& name) {
200 return controller_->CreateAppShortcutLauncherItem( 200 return controller_->CreateAppShortcutLauncherItem(
201 name, controller_->model()->item_count()); 201 name, shelf_model()->item_count());
202 } 202 }
203 203
204 const ash::ShelfItem& GetLastLauncherItem() { 204 const ash::ShelfItem& GetLastLauncherItem() {
205 // Unless there are any panels, the item at index [count - 1] will be 205 // Unless there are any panels, the item at index [count - 1] will be
206 // the desired item. 206 // the desired item.
207 return shelf_model()->items()[shelf_model()->item_count() - 1]; 207 return shelf_model()->items()[shelf_model()->item_count() - 1];
208 } 208 }
209 209
210 const ash::ShelfItem& GetLastLauncherPanelItem() { 210 const ash::ShelfItem& GetLastLauncherPanelItem() {
211 // Panels show up on the right side of the shelf, so the desired item 211 // Panels show up on the right side of the shelf, so the desired item
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 // Close all windows. 2291 // Close all windows.
2292 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); 2292 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE);
2293 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); 2293 EXPECT_EQ(0u, BrowserList::GetInstance()->size());
2294 2294
2295 // Check if "Close" is removed from the context menu. 2295 // Check if "Close" is removed from the context menu.
2296 std::unique_ptr<LauncherContextMenu> menu2 = 2296 std::unique_ptr<LauncherContextMenu> menu2 =
2297 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT); 2297 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT);
2298 ASSERT_FALSE( 2298 ASSERT_FALSE(
2299 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); 2299 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE));
2300 } 2300 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698