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

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

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)
Patch Set: cleanup Created 3 years, 7 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_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // otherwise launches and activates the app. 144 // otherwise launches and activates the app.
145 // Used by the app-list, and by pinned-app shelf items. 145 // Used by the app-list, and by pinned-app shelf items.
146 void ActivateApp(const std::string& app_id, 146 void ActivateApp(const std::string& app_id,
147 ash::ShelfLaunchSource source, 147 ash::ShelfLaunchSource source,
148 int event_flags); 148 int event_flags);
149 149
150 // Set the image for a specific shelf item (e.g. when set by the app). 150 // Set the image for a specific shelf item (e.g. when set by the app).
151 void SetLauncherItemImage(const ash::ShelfID& shelf_id, 151 void SetLauncherItemImage(const ash::ShelfID& shelf_id,
152 const gfx::ImageSkia& image); 152 const gfx::ImageSkia& image);
153 153
154 // Updates app item image from app image loader.
155 void UpdateAppItemImage(const std::string& app_id);
msw 2017/05/23 00:02:29 nit: rename UpdateLauncherItemImage for parity wit
khmel 2017/05/23 16:11:43 That is nice.
156
154 // Notify the controller that the state of an non platform app's tabs 157 // Notify the controller that the state of an non platform app's tabs
155 // have changed, 158 // have changed,
156 void UpdateAppState(content::WebContents* contents, AppState app_state); 159 void UpdateAppState(content::WebContents* contents, AppState app_state);
157 160
158 // Returns ShelfID for |contents|. If |contents| is not an app or is not 161 // Returns ShelfID for |contents|. If |contents| is not an app or is not
159 // pinned, returns the id of browser shrotcut. 162 // pinned, returns the id of browser shrotcut.
160 ash::ShelfID GetShelfIDForWebContents(content::WebContents* contents); 163 ash::ShelfID GetShelfIDForWebContents(content::WebContents* contents);
161 164
162 // Limits application refocusing to urls that match |url| for |id|. 165 // Limits application refocusing to urls that match |url| for |id|.
163 void SetRefocusURLPatternForTest(const ash::ShelfID& id, const GURL& url); 166 void SetRefocusURLPatternForTest(const ash::ShelfID& id, const GURL& url);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // animation predictions. 216 // animation predictions.
214 bool ShelfBoundsChangesProbablyWithUser(ash::WmShelf* shelf, 217 bool ShelfBoundsChangesProbablyWithUser(ash::WmShelf* shelf,
215 const AccountId& account_id) const; 218 const AccountId& account_id) const;
216 219
217 // Called when the user profile is fully loaded and ready to switch to. 220 // Called when the user profile is fully loaded and ready to switch to.
218 void OnUserProfileReadyToSwitch(Profile* profile); 221 void OnUserProfileReadyToSwitch(Profile* profile);
219 222
220 // Controller to launch ARC apps in deferred mode. 223 // Controller to launch ARC apps in deferred mode.
221 ArcAppDeferredLauncherController* GetArcDeferredLauncher(); 224 ArcAppDeferredLauncherController* GetArcDeferredLauncher();
222 225
223 AppIconLoader* GetAppIconLoaderForApp(const std::string& app_id);
224
225 // Sets the shelf auto-hide and/or alignment behavior from prefs. 226 // Sets the shelf auto-hide and/or alignment behavior from prefs.
226 void SetShelfAutoHideBehaviorFromPrefs(); 227 void SetShelfAutoHideBehaviorFromPrefs();
227 void SetShelfAlignmentFromPrefs(); 228 void SetShelfAlignmentFromPrefs();
228 void SetShelfBehaviorsFromPrefs(); 229 void SetShelfBehaviorsFromPrefs();
229 230
230 // Temporarily prevent pinned shelf item changes from updating the sync model. 231 // Temporarily prevent pinned shelf item changes from updating the sync model.
231 using ScopedPinSyncDisabler = std::unique_ptr<base::AutoReset<bool>>; 232 using ScopedPinSyncDisabler = std::unique_ptr<base::AutoReset<bool>>;
232 ScopedPinSyncDisabler GetScopedPinSyncDisabler(); 233 ScopedPinSyncDisabler GetScopedPinSyncDisabler();
233 234
234 // Access to the BrowserStatusMonitor for tests. 235 // Access to the BrowserStatusMonitor for tests.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 375
375 // app_list::AppListSyncableService::Observer: 376 // app_list::AppListSyncableService::Observer:
376 void OnSyncModelUpdated() override; 377 void OnSyncModelUpdated() override;
377 378
378 // sync_preferences::PrefServiceSyncableObserver: 379 // sync_preferences::PrefServiceSyncableObserver:
379 void OnIsSyncingChanged() override; 380 void OnIsSyncingChanged() override;
380 381
381 // An internal helper to unpin a shelf item; this does not update prefs. 382 // An internal helper to unpin a shelf item; this does not update prefs.
382 void UnpinShelfItemInternal(const ash::ShelfID& id); 383 void UnpinShelfItemInternal(const ash::ShelfID& id);
383 384
385 // Resolves app icon image loader for the app.
386 AppIconLoader* GetAppIconLoaderForApp(const std::string& app_id);
387
384 static ChromeLauncherController* instance_; 388 static ChromeLauncherController* instance_;
385 389
386 // The currently loaded profile used for prefs and loading extensions. This is 390 // The currently loaded profile used for prefs and loading extensions. This is
387 // NOT necessarily the profile new windows are created with. Note that in 391 // NOT necessarily the profile new windows are created with. Note that in
388 // multi-profile use cases this might change over time. 392 // multi-profile use cases this might change over time.
389 Profile* profile_ = nullptr; 393 Profile* profile_ = nullptr;
390 394
391 ash::ShelfModel* model_; 395 ash::ShelfModel* model_;
392 396
393 // Ash's mojom::ShelfController used to change shelf state. 397 // Ash's mojom::ShelfController used to change shelf state.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 using RunningAppListIds = std::vector<std::string>; 445 using RunningAppListIds = std::vector<std::string>;
442 using RunningAppListIdMap = std::map<std::string, RunningAppListIds>; 446 using RunningAppListIdMap = std::map<std::string, RunningAppListIds>;
443 RunningAppListIdMap last_used_running_application_order_; 447 RunningAppListIdMap last_used_running_application_order_;
444 448
445 base::WeakPtrFactory<ChromeLauncherController> weak_ptr_factory_; 449 base::WeakPtrFactory<ChromeLauncherController> weak_ptr_factory_;
446 450
447 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController); 451 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherController);
448 }; 452 };
449 453
450 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ 454 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698