| 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" | 
| 8 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" | 
| 9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" | 
| 10 #include "ash/shelf/shelf_button.h" | 10 #include "ash/shelf/shelf_button.h" | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
| 31 #include "chrome/browser/ui/app_list/app_list_service.h" | 31 #include "chrome/browser/ui/app_list/app_list_service.h" | 
| 32 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
      er.h" | 32 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
      er.h" | 
| 33 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" | 33 #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" | 
| 34 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 34 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 
| 35 #include "chrome/browser/ui/browser.h" | 35 #include "chrome/browser/ui/browser.h" | 
| 36 #include "chrome/browser/ui/browser_commands.h" | 36 #include "chrome/browser/ui/browser_commands.h" | 
| 37 #include "chrome/browser/ui/browser_finder.h" | 37 #include "chrome/browser/ui/browser_finder.h" | 
| 38 #include "chrome/browser/ui/browser_list.h" | 38 #include "chrome/browser/ui/browser_list.h" | 
| 39 #include "chrome/browser/ui/browser_window.h" | 39 #include "chrome/browser/ui/browser_window.h" | 
| 40 #include "chrome/browser/ui/chrome_pages.h" | 40 #include "chrome/browser/ui/chrome_pages.h" | 
|  | 41 #include "chrome/browser/ui/extensions/app_launch_params.h" | 
| 41 #include "chrome/browser/ui/extensions/application_launch.h" | 42 #include "chrome/browser/ui/extensions/application_launch.h" | 
| 42 #include "chrome/browser/ui/host_desktop.h" | 43 #include "chrome/browser/ui/host_desktop.h" | 
| 43 #include "chrome/browser/ui/settings_window_manager.h" | 44 #include "chrome/browser/ui/settings_window_manager.h" | 
| 44 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 45 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 
| 45 #include "chrome/common/chrome_switches.h" | 46 #include "chrome/common/chrome_switches.h" | 
| 46 #include "chrome/test/base/ui_test_utils.h" | 47 #include "chrome/test/base/ui_test_utils.h" | 
| 47 #include "content/public/browser/notification_service.h" | 48 #include "content/public/browser/notification_service.h" | 
| 48 #include "content/public/browser/notification_source.h" | 49 #include "content/public/browser/notification_source.h" | 
| 49 #include "content/public/browser/web_contents.h" | 50 #include "content/public/browser/web_contents.h" | 
| 50 #include "content/public/test/browser_test_utils.h" | 51 #include "content/public/test/browser_test_utils.h" | 
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 213       extensions::LaunchContainer container, | 214       extensions::LaunchContainer container, | 
| 214       WindowOpenDisposition disposition) { | 215       WindowOpenDisposition disposition) { | 
| 215     EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); | 216     EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); | 
| 216 | 217 | 
| 217     ExtensionService* service = extensions::ExtensionSystem::Get( | 218     ExtensionService* service = extensions::ExtensionSystem::Get( | 
| 218         profile())->extension_service(); | 219         profile())->extension_service(); | 
| 219     const Extension* extension = | 220     const Extension* extension = | 
| 220         service->GetExtensionById(last_loaded_extension_id(), false); | 221         service->GetExtensionById(last_loaded_extension_id(), false); | 
| 221     EXPECT_TRUE(extension); | 222     EXPECT_TRUE(extension); | 
| 222 | 223 | 
| 223     OpenApplication(AppLaunchParams(profile(), | 224     OpenApplication(AppLaunchParams(profile(), extension, container, | 
| 224                                     extension, | 225                                     disposition, extensions::SOURCE_UNTRACKED)); | 
| 225                                     container, |  | 
| 226                                     disposition)); |  | 
| 227     return extension; | 226     return extension; | 
| 228   } | 227   } | 
| 229 | 228 | 
| 230   ash::ShelfID CreateShortcut(const char* name) { | 229   ash::ShelfID CreateShortcut(const char* name) { | 
| 231     ExtensionService* service = extensions::ExtensionSystem::Get( | 230     ExtensionService* service = extensions::ExtensionSystem::Get( | 
| 232         profile())->extension_service(); | 231         profile())->extension_service(); | 
| 233     LoadExtension(test_data_dir_.AppendASCII(name)); | 232     LoadExtension(test_data_dir_.AppendASCII(name)); | 
| 234 | 233 | 
| 235     // First get app_id. | 234     // First get app_id. | 
| 236     const Extension* extension = | 235     const Extension* extension = | 
| (...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2071 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, V1AppNavigation) { | 2070 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, V1AppNavigation) { | 
| 2072   // We assume that the web store is always there (which it apparently is). | 2071   // We assume that the web store is always there (which it apparently is). | 
| 2073   controller_->PinAppWithID(extensions::kWebStoreAppId); | 2072   controller_->PinAppWithID(extensions::kWebStoreAppId); | 
| 2074   ash::ShelfID id = controller_->GetShelfIDForAppID( | 2073   ash::ShelfID id = controller_->GetShelfIDForAppID( | 
| 2075       extensions::kWebStoreAppId); | 2074       extensions::kWebStoreAppId); | 
| 2076   ASSERT_NE(0, id); | 2075   ASSERT_NE(0, id); | 
| 2077   EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); | 2076   EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); | 
| 2078 | 2077 | 
| 2079   // Create a windowed application. | 2078   // Create a windowed application. | 
| 2080   AppLaunchParams params( | 2079   AppLaunchParams params( | 
| 2081       profile(), | 2080       profile(), controller_->GetExtensionForAppID(extensions::kWebStoreAppId), | 
| 2082       controller_->GetExtensionForAppID(extensions::kWebStoreAppId), | 2081       0, chrome::HOST_DESKTOP_TYPE_ASH, extensions::SOURCE_UNTRACKED); | 
| 2083       0, |  | 
| 2084       chrome::HOST_DESKTOP_TYPE_ASH); |  | 
| 2085   params.container = extensions::LAUNCH_CONTAINER_WINDOW; | 2082   params.container = extensions::LAUNCH_CONTAINER_WINDOW; | 
| 2086   OpenApplication(params); | 2083   OpenApplication(params); | 
| 2087   EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); | 2084   EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); | 
| 2088 | 2085 | 
| 2089   // Find the browser which holds our app. | 2086   // Find the browser which holds our app. | 
| 2090   Browser* app_browser = NULL; | 2087   Browser* app_browser = NULL; | 
| 2091   const BrowserList* ash_browser_list = | 2088   const BrowserList* ash_browser_list = | 
| 2092       BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | 2089       BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | 
| 2093   for (BrowserList::const_reverse_iterator it = | 2090   for (BrowserList::const_reverse_iterator it = | 
| 2094            ash_browser_list->begin_last_active(); | 2091            ash_browser_list->begin_last_active(); | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2130       chrome::GetSettingsUrl(std::string())); | 2127       chrome::GetSettingsUrl(std::string())); | 
| 2131   Browser* settings_browser = | 2128   Browser* settings_browser = | 
| 2132       settings_manager->FindBrowserForProfile(browser()->profile()); | 2129       settings_manager->FindBrowserForProfile(browser()->profile()); | 
| 2133   ASSERT_TRUE(settings_browser); | 2130   ASSERT_TRUE(settings_browser); | 
| 2134   EXPECT_EQ(browser_count, NumberOfDetectedLauncherBrowsers(false)); | 2131   EXPECT_EQ(browser_count, NumberOfDetectedLauncherBrowsers(false)); | 
| 2135   EXPECT_EQ(item_count + 1, shelf_model->item_count()); | 2132   EXPECT_EQ(item_count + 1, shelf_model->item_count()); | 
| 2136 | 2133 | 
| 2137   // TODO(stevenjb): Test multiprofile on Chrome OS when test support is addded. | 2134   // TODO(stevenjb): Test multiprofile on Chrome OS when test support is addded. | 
| 2138   // crbug.com/230464. | 2135   // crbug.com/230464. | 
| 2139 } | 2136 } | 
| OLD | NEW | 
|---|