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

Unified Diff: ash/mus/shelf_delegate_mus.h

Issue 2259153002: mash: Port ash_sysui ShelfDelegateMus impl to mojo:ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 years, 4 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
« no previous file with comments | « ash/mus/root_window_controller.cc ('k') | ash/mus/shelf_delegate_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/shelf_delegate_mus.h
diff --git a/ash/mus/shelf_delegate_mus.h b/ash/mus/shelf_delegate_mus.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc87156005c25ce939a9cbe5e08e7ff69fa0dc01
--- /dev/null
+++ b/ash/mus/shelf_delegate_mus.h
@@ -0,0 +1,66 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_MUS_SHELF_DELEGATE_MUS_H_
+#define ASH_MUS_SHELF_DELEGATE_MUS_H_
+
+#include <map>
+#include <string>
+
+#include "ash/common/shelf/shelf_delegate.h"
+#include "ash/common/shelf/shelf_types.h"
+#include "ash/public/interfaces/shelf.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/bindings/interface_ptr_set.h"
+
+namespace ash {
+
+class ShelfModel;
+
+// Manages communication between the mash shelf and the browser.
+class ShelfDelegateMus : public ShelfDelegate, public mojom::ShelfController {
+ public:
+ explicit ShelfDelegateMus(ShelfModel* model);
+ ~ShelfDelegateMus() override;
+
+ private:
+ // ShelfDelegate:
+ void OnShelfCreated(WmShelf* shelf) override;
+ void OnShelfDestroyed(WmShelf* shelf) override;
+ void OnShelfAlignmentChanged(WmShelf* shelf) override;
+ void OnShelfAutoHideBehaviorChanged(WmShelf* shelf) override;
+ void OnShelfAutoHideStateChanged(WmShelf* shelf) override;
+ void OnShelfVisibilityStateChanged(WmShelf* shelf) override;
+ ShelfID GetShelfIDForAppID(const std::string& app_id) override;
+ bool HasShelfIDToAppIDMapping(ShelfID id) const override;
+ const std::string& GetAppIDForShelfID(ShelfID id) override;
+ void PinAppWithID(const std::string& app_id) override;
+ bool IsAppPinned(const std::string& app_id) override;
+ void UnpinAppWithID(const std::string& app_id) override;
+
+ // mojom::ShelfController:
+ void AddObserver(mojom::ShelfObserverAssociatedPtrInfo observer) override;
+ void SetAlignment(ShelfAlignment alignment, int64_t display_id) override;
+ void SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide,
+ int64_t display_id) override;
+ void PinItem(mojom::ShelfItemPtr item,
+ mojom::ShelfItemDelegateAssociatedPtrInfo delegate) override;
+ void UnpinItem(const std::string& app_id) override;
+ void SetItemImage(const std::string& app_id, const SkBitmap& image) override;
+
+ ShelfModel* model_;
+
+ mojo::AssociatedInterfacePtrSet<mojom::ShelfObserver> observers_;
+
+ std::map<uint32_t, ShelfID> window_id_to_shelf_id_;
+
+ std::map<std::string, ShelfID> app_id_to_shelf_id_;
+ std::map<ShelfID, std::string> shelf_id_to_app_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMus);
+};
+
+} // namespace ash
+
+#endif // ASH_MUS_SHELF_DELEGATE_MUS_H_
« no previous file with comments | « ash/mus/root_window_controller.cc ('k') | ash/mus/shelf_delegate_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698