| OLD | NEW |
| 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; | 27 const ash::ShelfItem* GetItem(ash::ShelfID id) const override; |
| 28 void SetItemType(ash::ShelfID id, ash::ShelfItemType type) override; | 28 void SetItemType(ash::ShelfID id, ash::ShelfItemType type) override; |
| 29 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; | 29 void SetItemStatus(ash::ShelfID id, ash::ShelfItemStatus status) override; |
| 30 void SetItemController(ash::ShelfID id, | 30 void SetItemController(ash::ShelfID id, |
| 31 LauncherItemController* controller) override; | 31 LauncherItemController* controller) override; |
| 32 void CloseLauncherItem(ash::ShelfID id) override; | 32 void CloseLauncherItem(ash::ShelfID id) override; |
| 33 void Pin(ash::ShelfID id) override; | 33 void Pin(ash::ShelfID id) override; |
| 34 void Unpin(ash::ShelfID id) override; | 34 void Unpin(ash::ShelfID id) override; |
| 35 bool IsPinned(ash::ShelfID id) override; | 35 bool IsPinned(ash::ShelfID id) override; |
| 36 void TogglePinned(ash::ShelfID id) override; | 36 void TogglePinned(ash::ShelfID id) override; |
| 37 bool IsPinnable(ash::ShelfID id) const override; | 37 bool IsPinnable(ash::ShelfID id) const override; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void OnAppImageUpdated(const std::string& app_id, | 86 void OnAppImageUpdated(const std::string& app_id, |
| 87 const gfx::ImageSkia& image) override; | 87 const gfx::ImageSkia& image) override; |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 // Pin the items set in the current profile's preferences. | 90 // Pin the items set in the current profile's preferences. |
| 91 void PinAppsFromPrefs(); | 91 void PinAppsFromPrefs(); |
| 92 | 92 |
| 93 std::map<std::string, std::unique_ptr<ChromeShelfItemDelegate>> | 93 std::map<std::string, std::unique_ptr<ChromeShelfItemDelegate>> |
| 94 app_id_to_item_delegate_; | 94 app_id_to_item_delegate_; |
| 95 | 95 |
| 96 // A fake item used for the unimplemented GetItem() override. | |
| 97 const ash::ShelfItem fake_item_; | |
| 98 | |
| 99 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerMus); | 96 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerMus); |
| 100 }; | 97 }; |
| 101 | 98 |
| 102 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_ | 99 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_MUS_H_ |
| OLD | NEW |