| 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 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void OnAppUninstalledPrepared(content::BrowserContext* browser_context, | 160 void OnAppUninstalledPrepared(content::BrowserContext* browser_context, |
| 161 const std::string& app_id) override; | 161 const std::string& app_id) override; |
| 162 | 162 |
| 163 protected: | 163 protected: |
| 164 // Creates a new app shortcut item and controller on the shelf at |index|. | 164 // Creates a new app shortcut item and controller on the shelf at |index|. |
| 165 // Use kInsertItemAtEnd to add a shortcut as the last item. | 165 // Use kInsertItemAtEnd to add a shortcut as the last item. |
| 166 ash::ShelfID CreateAppShortcutLauncherItem( | 166 ash::ShelfID CreateAppShortcutLauncherItem( |
| 167 const ash::launcher::AppLauncherId& app_launcher_id, | 167 const ash::launcher::AppLauncherId& app_launcher_id, |
| 168 int index); | 168 int index); |
| 169 | 169 |
| 170 const std::string& GetAppIdFromShelfIdForTest(ash::ShelfID id); | |
| 171 | |
| 172 private: | 170 private: |
| 173 friend class ChromeLauncherControllerImplTest; | 171 friend class ChromeLauncherControllerImplTest; |
| 174 friend class ShelfAppBrowserTest; | 172 friend class ShelfAppBrowserTest; |
| 175 friend class LauncherPlatformAppBrowserTest; | 173 friend class LauncherPlatformAppBrowserTest; |
| 176 FRIEND_TEST_ALL_PREFIXES(ChromeLauncherControllerImplTest, AppPanels); | 174 FRIEND_TEST_ALL_PREFIXES(ChromeLauncherControllerImplTest, AppPanels); |
| 177 | 175 |
| 178 typedef std::map<ash::ShelfID, LauncherItemController*> IDToItemControllerMap; | 176 typedef std::map<ash::ShelfID, LauncherItemController*> IDToItemControllerMap; |
| 179 typedef std::map<content::WebContents*, std::string> WebContentsToAppIDMap; | 177 typedef std::map<content::WebContents*, std::string> WebContentsToAppIDMap; |
| 180 | 178 |
| 181 // Remembers / restores list of running applications. | 179 // Remembers / restores list of running applications. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 const std::string& app_id, | 229 const std::string& app_id, |
| 232 ash::ShelfItemStatus status, | 230 ash::ShelfItemStatus status, |
| 233 int index, | 231 int index, |
| 234 ash::ShelfItemType shelf_item_type); | 232 ash::ShelfItemType shelf_item_type); |
| 235 | 233 |
| 236 // Enumerate all Web contents which match a given shortcut |controller|. | 234 // Enumerate all Web contents which match a given shortcut |controller|. |
| 237 std::vector<content::WebContents*> GetV1ApplicationsFromController( | 235 std::vector<content::WebContents*> GetV1ApplicationsFromController( |
| 238 LauncherItemController* controller); | 236 LauncherItemController* controller); |
| 239 | 237 |
| 240 // Create ShelfItem for Browser Shortcut. | 238 // Create ShelfItem for Browser Shortcut. |
| 241 ash::ShelfID CreateBrowserShortcutLauncherItem(); | 239 void CreateBrowserShortcutLauncherItem(); |
| 242 | 240 |
| 243 // Check if the given |web_contents| is in incognito mode. | 241 // Check if the given |web_contents| is in incognito mode. |
| 244 bool IsIncognito(const content::WebContents* web_contents) const; | 242 bool IsIncognito(const content::WebContents* web_contents) const; |
| 245 | 243 |
| 246 // Finds the index of where to insert the next item. | 244 // Finds the index of where to insert the next item. |
| 247 int FindInsertionPoint(); | 245 int FindInsertionPoint(); |
| 248 | 246 |
| 249 // Close all windowed V1 applications of a certain extension which was already | 247 // Close all windowed V1 applications of a certain extension which was already |
| 250 // deleted. | 248 // deleted. |
| 251 void CloseWindowedAppsFromRemovedExtension(const std::string& app_id, | 249 void CloseWindowedAppsFromRemovedExtension(const std::string& app_id, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 typedef std::vector<std::string> RunningAppListIds; | 320 typedef std::vector<std::string> RunningAppListIds; |
| 323 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; | 321 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; |
| 324 RunningAppListIdMap last_used_running_application_order_; | 322 RunningAppListIdMap last_used_running_application_order_; |
| 325 | 323 |
| 326 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; | 324 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; |
| 327 | 325 |
| 328 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); | 326 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); |
| 329 }; | 327 }; |
| 330 | 328 |
| 331 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ | 329 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ |
| OLD | NEW |