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

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: Sync and rebase. 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..1a10ef28dd48f0aee2e8c8cea200f1c20f6df3df
--- /dev/null
+++ b/chrome/browser/ui/ash/launcher/chrome_mash_shelf_controller.h
@@ -0,0 +1,48 @@
+// 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 <map>
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "mash/shelf/public/interfaces/shelf.mojom.h"
+#include "mojo/public/cpp/bindings/associated_binding.h"
+
+class ChromeShelfItemDelegate;
+
+// ChromeMashShelfController manages chrome's interaction with the mash shelf.
+class ChromeMashShelfController : public mash::shelf::mojom::ShelfObserver {
+ 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;
+
+ static ChromeMashShelfController* instance_;
+
+ mash::shelf::mojom::ShelfControllerPtr shelf_controller_;
+ mojo::AssociatedBinding<mash::shelf::mojom::ShelfObserver> observer_binding_;
+ std::map<std::string, scoped_ptr<ChromeShelfItemDelegate>>
+ app_id_to_item_delegate_;
+
+ 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