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

Unified Diff: ash/mus/sysui/shelf_delegate_mus.h

Issue 1684633002: ash/mash: Introduce a ShelfDelegate implementation for mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ash-sysui-window-container
Patch Set: self-nit Created 4 years, 10 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: ash/mus/sysui/shelf_delegate_mus.h
diff --git a/ash/mus/sysui/shelf_delegate_mus.h b/ash/mus/sysui/shelf_delegate_mus.h
new file mode 100644
index 0000000000000000000000000000000000000000..73f27fba233a097645b2a468cc22f4545fabd087
--- /dev/null
+++ b/ash/mus/sysui/shelf_delegate_mus.h
@@ -0,0 +1,58 @@
+// 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_SYSUI_SHELF_DELEGATE_MUS_H_
+#define ASH_MUS_SYSUI_SHELF_DELEGATE_MUS_H_
+
+#include <map>
+
+#include "ash/shelf/shelf_delegate.h"
+#include "mash/wm/public/interfaces/user_window_controller.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace ash {
+
+class ShelfModel;
+
+namespace sysui {
+
+class ShelfDelegateMus : public ShelfDelegate,
+ public mash::wm::mojom::UserWindowObserver {
+ public:
+ explicit ShelfDelegateMus(ShelfModel* model);
+ ~ShelfDelegateMus() override;
+
+ private:
+ // ShelfDelegate:
+ void OnShelfCreated(Shelf* shelf) override;
+ void OnShelfDestroyed(Shelf* 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;
+
+ // mash::wm::mojom::UserWindowObserver:
+ void OnUserWindowObserverAdded(
+ mojo::Array<mash::wm::mojom::UserWindowPtr> user_windows) override;
+ void OnUserWindowAdded(mash::wm::mojom::UserWindowPtr user_window) override;
+ void OnUserWindowRemoved(uint32_t window_id) override;
+ void OnUserWindowTitleChanged(uint32_t window_id,
+ const mojo::String& window_title) override;
+ void OnUserWindowFocusChanged(uint32_t window_id, bool has_focus) override;
+
+ ShelfModel* model_;
+
+ mash::wm::mojom::UserWindowControllerPtr user_window_controller_;
+ mojo::Binding<mash::wm::mojom::UserWindowObserver> binding_;
+ std::map<uint32_t, ShelfID> window_id_to_shelf_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMus);
+};
+
+} // namespace sysui
+} // namespace ash
+
+#endif // ASH_MUS_SYSUI_SHELF_DELEGATE_MUS_H_

Powered by Google App Engine
This is Rietveld 408576698