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

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

Issue 2545923004: Remove LauncherItemController::type; use ShelfItems::type. (Closed)
Patch Set: Rebase. Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_MUS_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_ 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
14 14
15 class ChromeShelfItemDelegate; 15 class ChromeShelfItemDelegate;
16 16
17 class ChromeLauncherControllerMus : public ChromeLauncherController { 17 class ChromeLauncherControllerMus : public ChromeLauncherController {
18 public: 18 public:
19 ChromeLauncherControllerMus(); 19 ChromeLauncherControllerMus();
20 ~ChromeLauncherControllerMus() override; 20 ~ChromeLauncherControllerMus() override;
21 21
22 // ChromeLauncherController: 22 // ChromeLauncherController:
23 void Init() override; 23 void Init() override;
24 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, 24 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller,
25 const std::string& app_id, 25 const std::string& app_id,
26 ash::ShelfItemStatus status) override; 26 ash::ShelfItemStatus status) override;
27 const ash::ShelfItem& GetItem(ash::ShelfID id) const override;
28 void SetItemType(ash::ShelfID id, ash::ShelfItemType type) override;
27 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; 29 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override;
28 void SetItemController(ash::ShelfID id, 30 void SetItemController(ash::ShelfID id,
29 LauncherItemController* controller) override; 31 LauncherItemController* controller) override;
30 void CloseLauncherItem(ash::ShelfID id) override; 32 void CloseLauncherItem(ash::ShelfID id) override;
31 void Pin(ash::ShelfID id) override; 33 void Pin(ash::ShelfID id) override;
32 void Unpin(ash::ShelfID id) override; 34 void Unpin(ash::ShelfID id) override;
33 bool IsPinned(ash::ShelfID id) override; 35 bool IsPinned(ash::ShelfID id) override;
34 void TogglePinned(ash::ShelfID id) override; 36 void TogglePinned(ash::ShelfID id) override;
35 bool IsPinnable(ash::ShelfID id) const override; 37 bool IsPinnable(ash::ShelfID id) const override;
36 void LockV1AppWithID(const std::string& app_id) override; 38 void LockV1AppWithID(const std::string& app_id) override;
(...skipping 17 matching lines...) Expand all
54 void SetRefocusURLPatternForTest(ash::ShelfID id, const GURL& url) override; 56 void SetRefocusURLPatternForTest(ash::ShelfID id, const GURL& url) override;
55 ash::ShelfItemDelegate::PerformedAction ActivateWindowOrMinimizeIfActive( 57 ash::ShelfItemDelegate::PerformedAction ActivateWindowOrMinimizeIfActive(
56 ui::BaseWindow* window, 58 ui::BaseWindow* window,
57 bool allow_minimize) override; 59 bool allow_minimize) override;
58 void ActiveUserChanged(const std::string& user_email) override; 60 void ActiveUserChanged(const std::string& user_email) override;
59 void AdditionalUserAddedToSession(Profile* profile) override; 61 void AdditionalUserAddedToSession(Profile* profile) override;
60 ChromeLauncherAppMenuItems GetApplicationList(const ash::ShelfItem& item, 62 ChromeLauncherAppMenuItems GetApplicationList(const ash::ShelfItem& item,
61 int event_flags) override; 63 int event_flags) override;
62 std::vector<content::WebContents*> GetV1ApplicationsFromAppId( 64 std::vector<content::WebContents*> GetV1ApplicationsFromAppId(
63 const std::string& app_id) override; 65 const std::string& app_id) override;
64 void ActivateShellApp(const std::string& app_id, int index) override; 66 void ActivateShellApp(const std::string& app_id, int window_index) override;
65 bool IsWebContentHandledByApplication(content::WebContents* web_contents, 67 bool IsWebContentHandledByApplication(content::WebContents* web_contents,
66 const std::string& app_id) override; 68 const std::string& app_id) override;
67 bool ContentCanBeHandledByGmailApp( 69 bool ContentCanBeHandledByGmailApp(
68 content::WebContents* web_contents) override; 70 content::WebContents* web_contents) override;
69 gfx::Image GetAppListIcon(content::WebContents* web_contents) const override; 71 gfx::Image GetAppListIcon(content::WebContents* web_contents) const override;
70 base::string16 GetAppListTitle( 72 base::string16 GetAppListTitle(
71 content::WebContents* web_contents) const override; 73 content::WebContents* web_contents) const override;
72 BrowserShortcutLauncherItemController* 74 BrowserShortcutLauncherItemController*
73 GetBrowserShortcutLauncherItemController() override; 75 GetBrowserShortcutLauncherItemController() override;
74 LauncherItemController* GetLauncherItemController( 76 LauncherItemController* GetLauncherItemController(
75 const ash::ShelfID id) override; 77 const ash::ShelfID id) override;
76 bool ShelfBoundsChangesProbablyWithUser( 78 bool ShelfBoundsChangesProbablyWithUser(
77 ash::WmShelf* shelf, 79 ash::WmShelf* shelf,
78 const AccountId& account_id) const override; 80 const AccountId& account_id) const override;
79 void OnUserProfileReadyToSwitch(Profile* profile) override; 81 void OnUserProfileReadyToSwitch(Profile* profile) override;
80 ArcAppDeferredLauncherController* GetArcDeferredLauncher() override; 82 ArcAppDeferredLauncherController* GetArcDeferredLauncher() override;
81 const std::string& GetLaunchIDForShelfID(ash::ShelfID id) override; 83 const std::string& GetLaunchIDForShelfID(ash::ShelfID id) override;
82 84
83 // AppIconLoaderDelegate: 85 // AppIconLoaderDelegate:
84 void OnAppImageUpdated(const std::string& app_id, 86 void OnAppImageUpdated(const std::string& app_id,
85 const gfx::ImageSkia& image) override; 87 const gfx::ImageSkia& image) override;
86 88
87 private: 89 private:
88 // Pin the items set in the current profile's preferences. 90 // Pin the items set in the current profile's preferences.
89 void PinAppsFromPrefs(); 91 void PinAppsFromPrefs();
90 92
91 std::map<std::string, std::unique_ptr<ChromeShelfItemDelegate>> 93 std::map<std::string, std::unique_ptr<ChromeShelfItemDelegate>>
92 app_id_to_item_delegate_; 94 app_id_to_item_delegate_;
93 95
96 // A fake item used for the unimplemented GetItem() override.
97 const ash::ShelfItem fake_item_;
James Cook 2016/12/02 19:27:18 optional: This could be a static ash::ShelfItem in
msw 2016/12/02 19:37:57 I tried that first and got error: declaration requ
98
94 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerMus); 99 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerMus);
95 }; 100 };
96 101
97 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_ 102 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698