| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 private app_list::AppListSyncableService::Observer { | 56 private app_list::AppListSyncableService::Observer { |
| 57 public: | 57 public: |
| 58 ChromeLauncherControllerImpl(Profile* profile, ash::ShelfModel* model); | 58 ChromeLauncherControllerImpl(Profile* profile, ash::ShelfModel* model); |
| 59 ~ChromeLauncherControllerImpl() override; | 59 ~ChromeLauncherControllerImpl() override; |
| 60 | 60 |
| 61 // ChromeLauncherController: | 61 // ChromeLauncherController: |
| 62 void Init() override; | 62 void Init() override; |
| 63 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, | 63 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, |
| 64 const std::string& app_id, | 64 const std::string& app_id, |
| 65 ash::ShelfItemStatus status) override; | 65 ash::ShelfItemStatus status) override; |
| 66 const ash::ShelfItem& GetItem(ash::ShelfID id) const override; |
| 67 void SetItemType(ash::ShelfID id, ash::ShelfItemType type) override; |
| 66 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; | 68 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; |
| 67 void SetItemController(ash::ShelfID id, | 69 void SetItemController(ash::ShelfID id, |
| 68 LauncherItemController* controller) override; | 70 LauncherItemController* controller) override; |
| 69 void CloseLauncherItem(ash::ShelfID id) override; | 71 void CloseLauncherItem(ash::ShelfID id) override; |
| 70 void Pin(ash::ShelfID id) override; | 72 void Pin(ash::ShelfID id) override; |
| 71 void Unpin(ash::ShelfID id) override; | 73 void Unpin(ash::ShelfID id) override; |
| 72 bool IsPinned(ash::ShelfID id) override; | 74 bool IsPinned(ash::ShelfID id) override; |
| 73 void TogglePinned(ash::ShelfID id) override; | 75 void TogglePinned(ash::ShelfID id) override; |
| 74 bool IsPinnable(ash::ShelfID id) const override; | 76 bool IsPinnable(ash::ShelfID id) const override; |
| 75 void LockV1AppWithID(const std::string& app_id) override; | 77 void LockV1AppWithID(const std::string& app_id) override; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 93 void SetRefocusURLPatternForTest(ash::ShelfID id, const GURL& url) override; | 95 void SetRefocusURLPatternForTest(ash::ShelfID id, const GURL& url) override; |
| 94 ash::ShelfItemDelegate::PerformedAction ActivateWindowOrMinimizeIfActive( | 96 ash::ShelfItemDelegate::PerformedAction ActivateWindowOrMinimizeIfActive( |
| 95 ui::BaseWindow* window, | 97 ui::BaseWindow* window, |
| 96 bool allow_minimize) override; | 98 bool allow_minimize) override; |
| 97 void ActiveUserChanged(const std::string& user_email) override; | 99 void ActiveUserChanged(const std::string& user_email) override; |
| 98 void AdditionalUserAddedToSession(Profile* profile) override; | 100 void AdditionalUserAddedToSession(Profile* profile) override; |
| 99 ChromeLauncherAppMenuItems GetApplicationList(const ash::ShelfItem& item, | 101 ChromeLauncherAppMenuItems GetApplicationList(const ash::ShelfItem& item, |
| 100 int event_flags) override; | 102 int event_flags) override; |
| 101 std::vector<content::WebContents*> GetV1ApplicationsFromAppId( | 103 std::vector<content::WebContents*> GetV1ApplicationsFromAppId( |
| 102 const std::string& app_id) override; | 104 const std::string& app_id) override; |
| 103 void ActivateShellApp(const std::string& app_id, int index) override; | 105 void ActivateShellApp(const std::string& app_id, int window_index) override; |
| 104 bool IsWebContentHandledByApplication(content::WebContents* web_contents, | 106 bool IsWebContentHandledByApplication(content::WebContents* web_contents, |
| 105 const std::string& app_id) override; | 107 const std::string& app_id) override; |
| 106 bool ContentCanBeHandledByGmailApp( | 108 bool ContentCanBeHandledByGmailApp( |
| 107 content::WebContents* web_contents) override; | 109 content::WebContents* web_contents) override; |
| 108 gfx::Image GetAppListIcon(content::WebContents* web_contents) const override; | 110 gfx::Image GetAppListIcon(content::WebContents* web_contents) const override; |
| 109 base::string16 GetAppListTitle( | 111 base::string16 GetAppListTitle( |
| 110 content::WebContents* web_contents) const override; | 112 content::WebContents* web_contents) const override; |
| 111 BrowserShortcutLauncherItemController* | 113 BrowserShortcutLauncherItemController* |
| 112 GetBrowserShortcutLauncherItemController() override; | 114 GetBrowserShortcutLauncherItemController() override; |
| 113 LauncherItemController* GetLauncherItemController( | 115 LauncherItemController* GetLauncherItemController( |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 216 |
| 215 // Creates an app launcher to insert at |index|. Note that |index| may be | 217 // Creates an app launcher to insert at |index|. Note that |index| may be |
| 216 // adjusted by the model to meet ordering constraints. | 218 // adjusted by the model to meet ordering constraints. |
| 217 // The |shelf_item_type| will be set into the ShelfModel. | 219 // The |shelf_item_type| will be set into the ShelfModel. |
| 218 ash::ShelfID InsertAppLauncherItem(LauncherItemController* controller, | 220 ash::ShelfID InsertAppLauncherItem(LauncherItemController* controller, |
| 219 const std::string& app_id, | 221 const std::string& app_id, |
| 220 ash::ShelfItemStatus status, | 222 ash::ShelfItemStatus status, |
| 221 int index, | 223 int index, |
| 222 ash::ShelfItemType shelf_item_type); | 224 ash::ShelfItemType shelf_item_type); |
| 223 | 225 |
| 224 // Enumerate all Web contents which match a given shortcut |controller|. | |
| 225 std::vector<content::WebContents*> GetV1ApplicationsFromController( | |
| 226 LauncherItemController* controller); | |
| 227 | |
| 228 // Create ShelfItem for Browser Shortcut. | 226 // Create ShelfItem for Browser Shortcut. |
| 229 void CreateBrowserShortcutLauncherItem(); | 227 void CreateBrowserShortcutLauncherItem(); |
| 230 | 228 |
| 231 // Check if the given |web_contents| is in incognito mode. | 229 // Check if the given |web_contents| is in incognito mode. |
| 232 bool IsIncognito(const content::WebContents* web_contents) const; | 230 bool IsIncognito(const content::WebContents* web_contents) const; |
| 233 | 231 |
| 234 // Finds the index of where to insert the next item. | 232 // Finds the index of where to insert the next item. |
| 235 int FindInsertionPoint(); | 233 int FindInsertionPoint(); |
| 236 | 234 |
| 237 // Close all windowed V1 applications of a certain extension which was already | 235 // Close all windowed V1 applications of a certain extension which was already |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 typedef std::vector<std::string> RunningAppListIds; | 308 typedef std::vector<std::string> RunningAppListIds; |
| 311 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; | 309 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; |
| 312 RunningAppListIdMap last_used_running_application_order_; | 310 RunningAppListIdMap last_used_running_application_order_; |
| 313 | 311 |
| 314 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; | 312 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; |
| 315 | 313 |
| 316 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); | 314 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); |
| 317 }; | 315 }; |
| 318 | 316 |
| 319 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ | 317 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ |
| OLD | NEW |