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_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
| 10 #include "ash/common/shelf/app_list_button.h" | 10 #include "ash/common/shelf/app_list_button.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 int icon_updates() { return icon_updates_; } | 121 int icon_updates() { return icon_updates_; } |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 Profile* profile_; | 124 Profile* profile_; |
| 125 int icon_updates_; | 125 int icon_updates_; |
| 126 | 126 |
| 127 DISALLOW_COPY_AND_ASSIGN(TestAppWindowRegistryObserver); | 127 DISALLOW_COPY_AND_ASSIGN(TestAppWindowRegistryObserver); |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 // Click the "All Apps" button from the app launcher start page. Assumes that | 130 // Click the "All Apps" button from the app launcher start page. Assumes that |
| 131 // the app launcher is open to the start page. On the non-experimental launcher, | 131 // the app launcher is open to the start page. On the non-experimental launcher, |
|
calamity
2016/09/21 07:54:10
nit: Remove last sentence here.
Matt Giuca
2016/09/22 06:49:44
Done.
| |
| 132 // does nothing. | 132 // does nothing. |
| 133 // |display_origin| is the top-left corner of the active display, in screen | 133 // |display_origin| is the top-left corner of the active display, in screen |
| 134 // coordinates. | 134 // coordinates. |
| 135 void ClickAllAppsButtonFromStartPage(ui::test::EventGenerator* generator, | 135 void ClickAllAppsButtonFromStartPage(ui::test::EventGenerator* generator, |
| 136 const gfx::Point& display_origin) { | 136 const gfx::Point& display_origin) { |
| 137 if (!app_list::switches::IsExperimentalAppListEnabled()) | |
| 138 return; | |
| 139 | |
| 140 AppListServiceAshTestApi service_test; | 137 AppListServiceAshTestApi service_test; |
| 141 | 138 |
| 142 app_list::StartPageView* start_page_view = service_test.GetStartPageView(); | 139 app_list::StartPageView* start_page_view = service_test.GetStartPageView(); |
| 143 DCHECK(start_page_view); | 140 DCHECK(start_page_view); |
| 144 | 141 |
| 145 app_list::TileItemView* all_apps_button = start_page_view->all_apps_button(); | 142 app_list::TileItemView* all_apps_button = start_page_view->all_apps_button(); |
| 146 gfx::Rect all_apps_rect = all_apps_button->GetBoundsInScreen(); | 143 gfx::Rect all_apps_rect = all_apps_button->GetBoundsInScreen(); |
| 147 all_apps_rect.Offset(-display_origin.x(), -display_origin.y()); | 144 all_apps_rect.Offset(-display_origin.x(), -display_origin.y()); |
| 148 generator->MoveMouseTo(all_apps_rect.CenterPoint().x(), | 145 generator->MoveMouseTo(all_apps_rect.CenterPoint().x(), |
| 149 all_apps_rect.CenterPoint().y()); | 146 all_apps_rect.CenterPoint().y()); |
| (...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2367 | 2364 |
| 2368 // Close all windows via the menu item. | 2365 // Close all windows via the menu item. |
| 2369 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2366 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2370 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2367 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2371 | 2368 |
| 2372 // Check if "Close" is removed from the context menu. | 2369 // Check if "Close" is removed from the context menu. |
| 2373 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2370 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
| 2374 ASSERT_FALSE( | 2371 ASSERT_FALSE( |
| 2375 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2372 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2376 } | 2373 } |
| OLD | NEW |