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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc

Issue 2718563008: mash: Use mojo for ShelfItemDelegate and [app] MenuItem. (Closed)
Patch Set: Address comments. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc
index 0136890fec78d8b26fa6c17d35077f4484901176..de0da5020bfdb1065eaa83b3f62f2c7452cbbeb5 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.cc
@@ -15,45 +15,6 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/events/event_constants.h"
-class ChromeShelfItemDelegate : public ash::mojom::ShelfItemDelegate {
- public:
- explicit ChromeShelfItemDelegate(const std::string& app_id,
- ChromeLauncherController* controller)
- : app_id_(app_id),
- item_delegate_binding_(this),
- controller_(controller) {}
- ~ChromeShelfItemDelegate() override {}
-
- ash::mojom::ShelfItemDelegateAssociatedPtrInfo
- CreateInterfacePtrInfoAndBind() {
- DCHECK(!item_delegate_binding_.is_bound());
- ash::mojom::ShelfItemDelegateAssociatedPtrInfo ptr_info;
- item_delegate_binding_.Bind(&ptr_info);
- return ptr_info;
- }
-
- private:
- // ash::mojom::ShelfItemDelegate:
- void LaunchItem() override {
- controller_->LaunchApp(ash::AppLauncherId(app_id_),
- ash::LAUNCH_FROM_UNKNOWN, ui::EF_NONE);
- }
- void ExecuteCommand(uint32_t command_id, int event_flags) override {
- NOTIMPLEMENTED();
- }
- void ItemPinned() override { NOTIMPLEMENTED(); }
- void ItemUnpinned() override { NOTIMPLEMENTED(); }
- void ItemReordered(uint32_t order) override { NOTIMPLEMENTED(); }
-
- std::string app_id_;
- mojo::AssociatedBinding<ash::mojom::ShelfItemDelegate> item_delegate_binding_;
-
- // Not owned.
- ChromeLauncherController* controller_;
-
- DISALLOW_COPY_AND_ASSIGN(ChromeShelfItemDelegate);
-};
-
ChromeLauncherControllerMus::ChromeLauncherControllerMus() {
AttachProfile(ProfileManager::GetActiveUserProfile());
}
@@ -182,11 +143,11 @@ void ChromeLauncherControllerMus::AdditionalUserAddedToSession(
NOTIMPLEMENTED();
}
-ash::ShelfAppMenuItemList
+std::vector<ash::mojom::MenuItemPtr>
ChromeLauncherControllerMus::GetAppMenuItemsForTesting(
const ash::ShelfItem& item) {
NOTIMPLEMENTED();
- return ash::ShelfAppMenuItemList();
+ return std::vector<ash::mojom::MenuItemPtr>();
}
std::vector<content::WebContents*>
@@ -290,13 +251,8 @@ void ChromeLauncherControllerMus::PinAppsFromPrefs() {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
const gfx::Image& image = rb.GetImageNamed(IDR_APP_DEFAULT_ICON);
item->image = *image.ToSkBitmap();
- std::unique_ptr<ChromeShelfItemDelegate> delegate(
- new ChromeShelfItemDelegate(app_id, this));
- shelf_controller()->PinItem(std::move(item),
- delegate->CreateInterfacePtrInfoAndBind());
- app_id_to_item_delegate_.insert(
- std::make_pair(app_id, std::move(delegate)));
-
+ // TOOD(msw): Actually pin the item and install its delegate; this code is
+ // unused at the moment. See http://crbug.com/647879
AppIconLoader* app_icon_loader = GetAppIconLoaderForApp(app_id);
if (app_icon_loader) {
app_icon_loader->FetchImage(app_id);

Powered by Google App Engine
This is Rietveld 408576698