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

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

Issue 2391253004: Use mojo Shelf interfaces for both mash and classic ash. (Closed)
Patch Set: Address comments. Created 4 years, 2 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 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 <memory> 9 #include <memory>
10 #include <string>
9 11
10 #include "base/macros.h" 12 #include "base/macros.h"
11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
12 14
13 class ChromeMashShelfController; 15 class ChromeShelfItemDelegate;
14 16
15 class ChromeLauncherControllerMus : public ChromeLauncherController { 17 class ChromeLauncherControllerMus : public ChromeLauncherController {
16 public: 18 public:
17 // Create a ChromeLauncherControllerMus instance and set it as the 19 ChromeLauncherControllerMus();
18 // ChromeLauncherController singleton.
19 static ChromeLauncherController* CreateInstance();
20
21 ~ChromeLauncherControllerMus() override; 20 ~ChromeLauncherControllerMus() override;
22 21
23 // ChromeLauncherController: 22 // ChromeLauncherController:
24 void Init() override; 23 void Init() override;
25 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller, 24 ash::ShelfID CreateAppLauncherItem(LauncherItemController* controller,
26 const std::string& app_id, 25 const std::string& app_id,
27 ash::ShelfItemStatus status) override; 26 ash::ShelfItemStatus status) override;
28 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; 27 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override;
29 void SetItemController(ash::ShelfID id, 28 void SetItemController(ash::ShelfID id,
30 LauncherItemController* controller) override; 29 LauncherItemController* controller) override;
31 void CloseLauncherItem(ash::ShelfID id) override; 30 void CloseLauncherItem(ash::ShelfID id) override;
32 void Pin(ash::ShelfID id) override; 31 void Pin(ash::ShelfID id) override;
33 void Unpin(ash::ShelfID id) override; 32 void Unpin(ash::ShelfID id) override;
34 bool IsPinned(ash::ShelfID id) override; 33 bool IsPinned(ash::ShelfID id) override;
35 void TogglePinned(ash::ShelfID id) override; 34 void TogglePinned(ash::ShelfID id) override;
36 bool IsPinnable(ash::ShelfID id) const override; 35 bool IsPinnable(ash::ShelfID id) const override;
37 void LockV1AppWithID(const std::string& app_id) override; 36 void LockV1AppWithID(const std::string& app_id) override;
38 void UnlockV1AppWithID(const std::string& app_id) override; 37 void UnlockV1AppWithID(const std::string& app_id) override;
39 void Launch(ash::ShelfID id, int event_flags) override; 38 void Launch(ash::ShelfID id, int event_flags) override;
40 void Close(ash::ShelfID id) override; 39 void Close(ash::ShelfID id) override;
41 bool IsOpen(ash::ShelfID id) override; 40 bool IsOpen(ash::ShelfID id) override;
42 bool IsPlatformApp(ash::ShelfID id) override; 41 bool IsPlatformApp(ash::ShelfID id) override;
43 void LaunchApp(const std::string& app_id,
44 ash::LaunchSource source,
45 int event_flags) override;
46 void ActivateApp(const std::string& app_id, 42 void ActivateApp(const std::string& app_id,
47 ash::LaunchSource source, 43 ash::LaunchSource source,
48 int event_flags) override; 44 int event_flags) override;
49 extensions::LaunchType GetLaunchType(ash::ShelfID id) override; 45 extensions::LaunchType GetLaunchType(ash::ShelfID id) override;
50 void SetLauncherItemImage(ash::ShelfID shelf_id, 46 void SetLauncherItemImage(ash::ShelfID shelf_id,
51 const gfx::ImageSkia& image) override; 47 const gfx::ImageSkia& image) override;
52 bool IsWindowedAppInLauncher(const std::string& app_id) override; 48 bool IsWindowedAppInLauncher(const std::string& app_id) override;
53 void SetLaunchType(ash::ShelfID id, 49 void SetLaunchType(ash::ShelfID id,
54 extensions::LaunchType launch_type) override; 50 extensions::LaunchType launch_type) override;
55 Profile* GetProfile() override;
56 void UpdateAppState(content::WebContents* contents, 51 void UpdateAppState(content::WebContents* contents,
57 AppState app_state) override; 52 AppState app_state) override;
58 ash::ShelfID GetShelfIDForWebContents( 53 ash::ShelfID GetShelfIDForWebContents(
59 content::WebContents* contents) override; 54 content::WebContents* contents) override;
60 void SetRefocusURLPatternForTest(ash::ShelfID id, const GURL& url) override; 55 void SetRefocusURLPatternForTest(ash::ShelfID id, const GURL& url) override;
61 ash::ShelfItemDelegate::PerformedAction ActivateWindowOrMinimizeIfActive( 56 ash::ShelfItemDelegate::PerformedAction ActivateWindowOrMinimizeIfActive(
62 ui::BaseWindow* window, 57 ui::BaseWindow* window,
63 bool allow_minimize) override; 58 bool allow_minimize) override;
64 void ActiveUserChanged(const std::string& user_email) override; 59 void ActiveUserChanged(const std::string& user_email) override;
65 void AdditionalUserAddedToSession(Profile* profile) override; 60 void AdditionalUserAddedToSession(Profile* profile) override;
(...skipping 12 matching lines...) Expand all
78 BrowserShortcutLauncherItemController* 73 BrowserShortcutLauncherItemController*
79 GetBrowserShortcutLauncherItemController() override; 74 GetBrowserShortcutLauncherItemController() override;
80 LauncherItemController* GetLauncherItemController( 75 LauncherItemController* GetLauncherItemController(
81 const ash::ShelfID id) override; 76 const ash::ShelfID id) override;
82 bool ShelfBoundsChangesProbablyWithUser( 77 bool ShelfBoundsChangesProbablyWithUser(
83 ash::WmShelf* shelf, 78 ash::WmShelf* shelf,
84 const AccountId& account_id) const override; 79 const AccountId& account_id) const override;
85 void OnUserProfileReadyToSwitch(Profile* profile) override; 80 void OnUserProfileReadyToSwitch(Profile* profile) override;
86 ArcAppDeferredLauncherController* GetArcDeferredLauncher() override; 81 ArcAppDeferredLauncherController* GetArcDeferredLauncher() override;
87 82
83 // AppIconLoaderDelegate:
84 void OnAppImageUpdated(const std::string& app_id,
85 const gfx::ImageSkia& image) override;
86
88 private: 87 private:
89 ChromeLauncherControllerMus(); 88 // Pin the items set in the current profile's preferences.
89 void PinAppsFromPrefs();
90 90
91 std::unique_ptr<ChromeMashShelfController> shelf_controller_; 91 std::map<std::string, std::unique_ptr<ChromeShelfItemDelegate>>
92 app_id_to_item_delegate_;
92 93
93 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerMus); 94 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerMus);
94 }; 95 };
95 96
96 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_ 97 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698