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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h

Issue 1839223003: Add basic Chrome interaction with the mash shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move chrome_launcher_prefs from ash to aura. Created 4 years, 8 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_mash_shelf_controller.h
diff --git a/chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h b/chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..4b55fa7880b249cc2522d93745484da482952382
--- /dev/null
+++ b/chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h
@@ -0,0 +1,49 @@
+// 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 CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_MASH_SHELF_CONTROLLER_H_
+#define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_MASH_SHELF_CONTROLLER_H_
+
+#include "mash/shelf/public/interfaces/shelf.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+// ChromeMashShelfController manages chrome's interaction with the mash shelf.
+class ChromeMashShelfController : public mash::shelf::mojom::ShelfObserver,
+ public mash::shelf::mojom::ShelfItemDelegate {
+ public:
+ ~ChromeMashShelfController() override;
+
+ // Creates an instance.
+ static ChromeMashShelfController* CreateInstance();
+
+ // Returns the single ChromeMashShelfController instance.
+ static ChromeMashShelfController* instance() { return instance_; }
+
+ private:
+ ChromeMashShelfController();
+
+ void Init();
+
+ // mash::shelf::mojom::ShelfObserver:
+ void OnAlignmentChanged(mash::shelf::mojom::Alignment alignment) override;
+ void OnAutoHideBehaviorChanged(
+ mash::shelf::mojom::AutoHideBehavior auto_hide) override;
+
+ // mash::shelf::mojom::ShelfItemDelegate:
+ void ExecuteCommand(const mojo::String& id,
+ uint32_t command_id,
+ int32_t event_flags) override;
+ void ItemRemoved(const mojo::String& id) override;
+ void ItemReordered(const mojo::String& id, uint32_t order) override;
+
+ static ChromeMashShelfController* instance_;
+
+ mash::shelf::mojom::ShelfPtr shelf_;
+ mojo::Binding<mash::shelf::mojom::ShelfObserver> observer_binding_;
+ mojo::Binding<mash::shelf::mojom::ShelfItemDelegate> item_delegate_binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeMashShelfController);
+};
+
+#endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_MASH_SHELF_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698