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