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

Unified Diff: mash/shelf/shelf_view.h

Issue 1576683002: Add rudimentary mash shelf functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 11 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 | « mash/shelf/shelf_application.cc ('k') | mash/shelf/shelf_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/shelf/shelf_view.h
diff --git a/mash/shelf/shelf_view.h b/mash/shelf/shelf_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..f631dbd1b2e9a80b7dbb8a398e520bcbddbca356
--- /dev/null
+++ b/mash/shelf/shelf_view.h
@@ -0,0 +1,62 @@
+// Copyright 2015 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 MASH_SHELF_SHELF_VIEW_H_
+#define MASH_SHELF_SHELF_VIEW_H_
+
+#include <stdint.h>
+
+#include "base/macros.h"
+#include "mash/wm/public/interfaces/user_window_controller.mojom.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "ui/views/controls/button/button.h"
+#include "ui/views/widget/widget_delegate.h"
+
+namespace mojo {
+class ApplicationImpl;
+}
+
+namespace views {
+class LabelButton;
+}
+
+namespace mash {
+namespace shelf {
+
+// A rudimentary mash shelf, used to build up the required wm interfaces.
+class ShelfView : public views::WidgetDelegateView,
+ public views::ButtonListener,
+ public mash::wm::mojom::UserWindowObserver {
+ public:
+ explicit ShelfView(mojo::ApplicationImpl* app);
+ ~ShelfView() override;
+
+ private:
+ // Overridden from views::View:
+ void OnPaint(gfx::Canvas* canvas) override;
+ gfx::Size GetPreferredSize() const override;
+
+ // Overridden from views::WidgetDelegate:
+ views::View* GetContentsView() override;
+
+ // Overridden from views::ButtonListener:
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
+
+ // Overridden from mash::wm::mojom::UserWindowObserver:
+ void OnUserWindowObserverAdded(mojo::Array<uint32_t> window_ids) override;
+ void OnUserWindowAdded(uint32_t window_id) override;
+ void OnUserWindowRemoved(uint32_t window_id) override;
+
+ mojo::ApplicationImpl* app_;
+ std::vector<views::LabelButton*> open_window_buttons_;
+ mash::wm::mojom::UserWindowControllerPtr user_window_controller_;
+ mojo::Binding<mash::wm::mojom::UserWindowObserver> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShelfView);
+};
+
+} // namespace shelf
+} // namespace mash
+
+#endif // MASH_SHELF_SHELF_VIEW_H_
« no previous file with comments | « mash/shelf/shelf_application.cc ('k') | mash/shelf/shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698