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

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

Powered by Google App Engine
This is Rietveld 408576698