| 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/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/chrome_notification_types.h" | 29 #include "chrome/browser/chrome_notification_types.h" |
| 30 #include "chrome/browser/extensions/extension_apitest.h" | 30 #include "chrome/browser/extensions/extension_apitest.h" |
| 31 #include "chrome/browser/extensions/extension_browsertest.h" | 31 #include "chrome/browser/extensions/extension_browsertest.h" |
| 32 #include "chrome/browser/extensions/extension_function_test_utils.h" | 32 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 33 #include "chrome/browser/extensions/extension_service.h" | 33 #include "chrome/browser/extensions/extension_service.h" |
| 34 #include "chrome/browser/extensions/launch_util.h" | 34 #include "chrome/browser/extensions/launch_util.h" |
| 35 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/ui/app_list/app_list_service.h" | 36 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 37 #include "chrome/browser/ui/ash/app_list/test/app_list_service_ash_test_api.h" | 37 #include "chrome/browser/ui/ash/app_list/test/app_list_service_ash_test_api.h" |
| 38 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" | 38 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" |
| 39 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h" |
| 39 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" | 40 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" |
| 40 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 41 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
| 41 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 42 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| 42 #include "chrome/browser/ui/browser.h" | 43 #include "chrome/browser/ui/browser.h" |
| 43 #include "chrome/browser/ui/browser_commands.h" | 44 #include "chrome/browser/ui/browser_commands.h" |
| 44 #include "chrome/browser/ui/browser_finder.h" | 45 #include "chrome/browser/ui/browser_finder.h" |
| 45 #include "chrome/browser/ui/browser_list.h" | 46 #include "chrome/browser/ui/browser_list.h" |
| 46 #include "chrome/browser/ui/browser_window.h" | 47 #include "chrome/browser/ui/browser_window.h" |
| 47 #include "chrome/browser/ui/chrome_pages.h" | 48 #include "chrome/browser/ui/chrome_pages.h" |
| 48 #include "chrome/browser/ui/extensions/app_launch_params.h" | 49 #include "chrome/browser/ui/extensions/app_launch_params.h" |
| (...skipping 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, V1AppNavigation) { | 2114 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, V1AppNavigation) { |
| 2114 // We assume that the web store is always there (which it apparently is). | 2115 // We assume that the web store is always there (which it apparently is). |
| 2115 controller_->PinAppWithID(extensions::kWebStoreAppId); | 2116 controller_->PinAppWithID(extensions::kWebStoreAppId); |
| 2116 ash::ShelfID id = controller_->GetShelfIDForAppID( | 2117 ash::ShelfID id = controller_->GetShelfIDForAppID( |
| 2117 extensions::kWebStoreAppId); | 2118 extensions::kWebStoreAppId); |
| 2118 ASSERT_NE(0, id); | 2119 ASSERT_NE(0, id); |
| 2119 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); | 2120 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); |
| 2120 | 2121 |
| 2121 // Create a windowed application. | 2122 // Create a windowed application. |
| 2122 AppLaunchParams params = CreateAppLaunchParamsUserContainer( | 2123 AppLaunchParams params = CreateAppLaunchParamsUserContainer( |
| 2123 profile(), controller_->GetExtensionForAppID(extensions::kWebStoreAppId), | 2124 profile(), GetExtensionForAppID(extensions::kWebStoreAppId, profile()), |
| 2124 NEW_FOREGROUND_TAB, extensions::SOURCE_TEST); | 2125 NEW_FOREGROUND_TAB, extensions::SOURCE_TEST); |
| 2125 params.container = extensions::LAUNCH_CONTAINER_WINDOW; | 2126 params.container = extensions::LAUNCH_CONTAINER_WINDOW; |
| 2126 OpenApplication(params); | 2127 OpenApplication(params); |
| 2127 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); | 2128 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); |
| 2128 | 2129 |
| 2129 // Find the browser which holds our app. | 2130 // Find the browser which holds our app. |
| 2130 Browser* app_browser = NULL; | 2131 Browser* app_browser = NULL; |
| 2131 const BrowserList* browser_list = BrowserList::GetInstance(); | 2132 const BrowserList* browser_list = BrowserList::GetInstance(); |
| 2132 for (BrowserList::const_reverse_iterator it = | 2133 for (BrowserList::const_reverse_iterator it = |
| 2133 browser_list->begin_last_active(); | 2134 browser_list->begin_last_active(); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2295 // Close all windows. | 2296 // Close all windows. |
| 2296 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2297 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2297 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2298 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2298 | 2299 |
| 2299 // Check if "Close" is removed from the context menu. | 2300 // Check if "Close" is removed from the context menu. |
| 2300 std::unique_ptr<LauncherContextMenu> menu2 = | 2301 std::unique_ptr<LauncherContextMenu> menu2 = |
| 2301 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT); | 2302 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT); |
| 2302 ASSERT_FALSE( | 2303 ASSERT_FALSE( |
| 2303 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2304 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2304 } | 2305 } |
| OLD | NEW |