OLD | NEW |
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 "apps/shell_window.h" | 7 #include "apps/shell_window.h" |
8 #include "apps/shell_window_registry.h" | 8 #include "apps/shell_window_registry.h" |
9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
11 #include "ash/display/display_controller.h" | 11 #include "ash/display/display_controller.h" |
12 #include "ash/launcher/launcher.h" | 12 #include "ash/launcher/launcher.h" |
13 #include "ash/launcher/launcher_button.h" | 13 #include "ash/launcher/launcher_button.h" |
14 #include "ash/shelf/shelf_model.h" | 14 #include "ash/shelf/shelf_model.h" |
15 #include "ash/shelf/shelf_model_util.h" | |
16 #include "ash/shelf/shelf_util.h" | 15 #include "ash/shelf/shelf_util.h" |
17 #include "ash/shelf/shelf_view.h" | 16 #include "ash/shelf/shelf_view.h" |
18 #include "ash/shell.h" | 17 #include "ash/shell.h" |
19 #include "ash/test/app_list_controller_test_api.h" | 18 #include "ash/test/app_list_controller_test_api.h" |
20 #include "ash/test/launcher_test_api.h" | 19 #include "ash/test/launcher_test_api.h" |
21 #include "ash/test/shelf_view_test_api.h" | 20 #include "ash/test/shelf_view_test_api.h" |
22 #include "ash/test/shell_test_api.h" | 21 #include "ash/test/shell_test_api.h" |
23 #include "ash/wm/window_state.h" | 22 #include "ash/wm/window_state.h" |
24 #include "ash/wm/window_util.h" | 23 #include "ash/wm/window_util.h" |
25 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 launcher_->ActivateLauncherItem(id); | 261 launcher_->ActivateLauncherItem(id); |
263 } | 262 } |
264 | 263 |
265 ash::LauncherID PinFakeApp(const std::string& name) { | 264 ash::LauncherID PinFakeApp(const std::string& name) { |
266 return controller_->CreateAppShortcutLauncherItem( | 265 return controller_->CreateAppShortcutLauncherItem( |
267 name, model_->item_count()); | 266 name, model_->item_count()); |
268 } | 267 } |
269 | 268 |
270 // Get the index of an item which has the given type. | 269 // Get the index of an item which has the given type. |
271 int GetIndexOfShelfItemType(ash::LauncherItemType type) { | 270 int GetIndexOfShelfItemType(ash::LauncherItemType type) { |
272 return ash::GetShelfItemIndexForType(type, *model_); | 271 return model_->GetItemIndexForType(type); |
273 } | 272 } |
274 | 273 |
275 // Try to rip off |item_index|. | 274 // Try to rip off |item_index|. |
276 void RipOffItemIndex(int index, | 275 void RipOffItemIndex(int index, |
277 aura::test::EventGenerator* generator, | 276 aura::test::EventGenerator* generator, |
278 ash::test::ShelfViewTestAPI* test, | 277 ash::test::ShelfViewTestAPI* test, |
279 RipOffCommand command) { | 278 RipOffCommand command) { |
280 ash::internal::LauncherButton* button = test->GetButton(index); | 279 ash::internal::LauncherButton* button = test->GetButton(index); |
281 gfx::Point start_point = button->GetBoundsInScreen().CenterPoint(); | 280 gfx::Point start_point = button->GetBoundsInScreen().CenterPoint(); |
282 gfx::Point rip_off_point(start_point.x(), 0); | 281 gfx::Point rip_off_point(start_point.x(), 0); |
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1914 GURL("http://www.foo.com/bar.html")); | 1913 GURL("http://www.foo.com/bar.html")); |
1915 // Make sure the navigation was entirely performed. | 1914 // Make sure the navigation was entirely performed. |
1916 base::MessageLoop::current()->RunUntilIdle(); | 1915 base::MessageLoop::current()->RunUntilIdle(); |
1917 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); | 1916 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); |
1918 app_browser->tab_strip_model()->CloseWebContentsAt(0, | 1917 app_browser->tab_strip_model()->CloseWebContentsAt(0, |
1919 TabStripModel::CLOSE_NONE); | 1918 TabStripModel::CLOSE_NONE); |
1920 // Make sure that the app is really gone. | 1919 // Make sure that the app is really gone. |
1921 base::MessageLoop::current()->RunUntilIdle(); | 1920 base::MessageLoop::current()->RunUntilIdle(); |
1922 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); | 1921 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); |
1923 } | 1922 } |
OLD | NEW |