Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1317)

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h

Issue 2771663002: mash: Refactor ChromeLauncherController's ShelfDelegate code. (Closed)
Patch Set: Address comments. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // ChromeLauncherController: 63 // ChromeLauncherController:
64 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, 64 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller,
65 ash::ShelfItemStatus status) override; 65 ash::ShelfItemStatus status) override;
66 const ash::ShelfItem* GetItem(ash::ShelfID id) const override; 66 const ash::ShelfItem* GetItem(ash::ShelfID id) const override;
67 void SetItemType(ash::ShelfID id, ash::ShelfItemType type) override; 67 void SetItemType(ash::ShelfID id, ash::ShelfItemType type) override;
68 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; 68 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override;
69 void SetItemController(ash::ShelfID id, 69 void SetItemController(ash::ShelfID id,
70 LauncherItemController* controller) override; 70 LauncherItemController* controller) override;
71 void CloseLauncherItem(ash::ShelfID id) override; 71 void CloseLauncherItem(ash::ShelfID id) override;
72 void Pin(ash::ShelfID id) override;
73 void Unpin(ash::ShelfID id) override;
74 bool IsPinned(ash::ShelfID id) override; 72 bool IsPinned(ash::ShelfID id) override;
75 void TogglePinned(ash::ShelfID id) override;
76 void LockV1AppWithID(const std::string& app_id) override; 73 void LockV1AppWithID(const std::string& app_id) override;
77 void UnlockV1AppWithID(const std::string& app_id) override; 74 void UnlockV1AppWithID(const std::string& app_id) override;
78 void Launch(ash::ShelfID id, int event_flags) override; 75 void Launch(ash::ShelfID id, int event_flags) override;
79 void Close(ash::ShelfID id) override; 76 void Close(ash::ShelfID id) override;
80 bool IsOpen(ash::ShelfID id) override; 77 bool IsOpen(ash::ShelfID id) override;
81 bool IsPlatformApp(ash::ShelfID id) override; 78 bool IsPlatformApp(ash::ShelfID id) override;
82 void ActivateApp(const std::string& app_id, 79 void ActivateApp(const std::string& app_id,
83 ash::ShelfLaunchSource source, 80 ash::ShelfLaunchSource source,
84 int event_flags) override; 81 int event_flags) override;
85 void SetLauncherItemImage(ash::ShelfID shelf_id, 82 void SetLauncherItemImage(ash::ShelfID shelf_id,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const std::vector<std::unique_ptr<AppWindowLauncherController>>& 123 const std::vector<std::unique_ptr<AppWindowLauncherController>>&
127 app_window_controllers_for_test() { 124 app_window_controllers_for_test() {
128 return app_window_controllers_; 125 return app_window_controllers_;
129 } 126 }
130 127
131 // ash::ShelfDelegate: 128 // ash::ShelfDelegate:
132 ash::ShelfID GetShelfIDForAppID(const std::string& app_id) override; 129 ash::ShelfID GetShelfIDForAppID(const std::string& app_id) override;
133 ash::ShelfID GetShelfIDForAppIDAndLaunchID( 130 ash::ShelfID GetShelfIDForAppIDAndLaunchID(
134 const std::string& app_id, 131 const std::string& app_id,
135 const std::string& launch_id) override; 132 const std::string& launch_id) override;
136 bool HasShelfIDToAppIDMapping(ash::ShelfID id) const override;
137 const std::string& GetAppIDForShelfID(ash::ShelfID id) override; 133 const std::string& GetAppIDForShelfID(ash::ShelfID id) override;
138 void PinAppWithID(const std::string& app_id) override; 134 void PinAppWithID(const std::string& app_id) override;
139 bool IsAppPinned(const std::string& app_id) override; 135 bool IsAppPinned(const std::string& app_id) override;
140 void UnpinAppWithID(const std::string& app_id) override; 136 void UnpinAppWithID(const std::string& app_id) override;
141 137
142 // LauncherAppUpdater::Delegate: 138 // LauncherAppUpdater::Delegate:
143 void OnAppInstalled(content::BrowserContext* browser_context, 139 void OnAppInstalled(content::BrowserContext* browser_context,
144 const std::string& app_id) override; 140 const std::string& app_id) override;
145 void OnAppUpdated(content::BrowserContext* browser_context, 141 void OnAppUpdated(content::BrowserContext* browser_context,
146 const std::string& app_id) override; 142 const std::string& app_id) override;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // AppIconLoaderDelegate: 260 // AppIconLoaderDelegate:
265 void OnAppImageUpdated(const std::string& app_id, 261 void OnAppImageUpdated(const std::string& app_id,
266 const gfx::ImageSkia& image) override; 262 const gfx::ImageSkia& image) override;
267 263
268 // app_list::AppListSyncableService::Observer: 264 // app_list::AppListSyncableService::Observer:
269 void OnSyncModelUpdated() override; 265 void OnSyncModelUpdated() override;
270 266
271 // sync_preferences::PrefServiceSyncableObserver: 267 // sync_preferences::PrefServiceSyncableObserver:
272 void OnIsSyncingChanged() override; 268 void OnIsSyncingChanged() override;
273 269
274 // Unpins shelf item and optionally updates pin prefs when |update_prefs| is 270 // An internal helper to unpin a shelf item; this does not update prefs.
275 // set to true. 271 void UnpinShelfItemInternal(ash::ShelfID id);
276 void UnpinAndUpdatePrefs(ash::ShelfID id, bool update_prefs);
277 272
278 ash::ShelfModel* model_; 273 ash::ShelfModel* model_;
279 274
280 // Controller items in this map are owned by |ShelfModel|. 275 // Controller items in this map are owned by |ShelfModel|.
281 IDToItemControllerMap id_to_item_controller_map_; 276 IDToItemControllerMap id_to_item_controller_map_;
282 277
283 // Direct access to app_id for a web contents. 278 // Direct access to app_id for a web contents.
284 WebContentsToAppIDMap web_contents_to_app_id_; 279 WebContentsToAppIDMap web_contents_to_app_id_;
285 280
286 // Used to track app windows. 281 // Used to track app windows.
(...skipping 26 matching lines...) Expand all
313 typedef std::vector<std::string> RunningAppListIds; 308 typedef std::vector<std::string> RunningAppListIds;
314 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap; 309 typedef std::map<std::string, RunningAppListIds> RunningAppListIdMap;
315 RunningAppListIdMap last_used_running_application_order_; 310 RunningAppListIdMap last_used_running_application_order_;
316 311
317 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_; 312 base::WeakPtrFactory<ChromeLauncherControllerImpl> weak_ptr_factory_;
318 313
319 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl); 314 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerImpl);
320 }; 315 };
321 316
322 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_ 317 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698