OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MASH_SHELF_SHELF_VIEW_H_ |
| 6 #define MASH_SHELF_SHELF_VIEW_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" |
| 12 #include "mojo/public/cpp/bindings/binding.h" |
| 13 #include "ui/views/controls/button/button.h" |
| 14 #include "ui/views/widget/widget_delegate.h" |
| 15 |
| 16 namespace mojo { |
| 17 class ApplicationImpl; |
| 18 } |
| 19 |
| 20 namespace views { |
| 21 class LabelButton; |
| 22 } |
| 23 |
| 24 namespace mash { |
| 25 namespace shelf { |
| 26 |
| 27 // A rudimentary mash shelf, used to build up the required wm interfaces. |
| 28 class ShelfView : public views::WidgetDelegateView, |
| 29 public views::ButtonListener, |
| 30 public mash::wm::mojom::UserWindowObserver { |
| 31 public: |
| 32 explicit ShelfView(mojo::ApplicationImpl* app); |
| 33 ~ShelfView() override; |
| 34 |
| 35 private: |
| 36 // Overridden from views::View: |
| 37 void OnPaint(gfx::Canvas* canvas) override; |
| 38 gfx::Size GetPreferredSize() const override; |
| 39 |
| 40 // Overridden from views::WidgetDelegate: |
| 41 views::View* GetContentsView() override; |
| 42 |
| 43 // Overridden from views::ButtonListener: |
| 44 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 45 |
| 46 // Overridden from mash::wm::mojom::UserWindowObserver: |
| 47 void OnUserWindowObserverAdded(mojo::Array<uint32_t> window_ids) override; |
| 48 void OnUserWindowAdded(uint32_t window_id) override; |
| 49 void OnUserWindowRemoved(uint32_t window_id) override; |
| 50 |
| 51 mojo::ApplicationImpl* app_; |
| 52 std::vector<views::LabelButton*> open_window_buttons_; |
| 53 mash::wm::mojom::UserWindowControllerPtr user_window_controller_; |
| 54 mojo::Binding<mash::wm::mojom::UserWindowObserver> binding_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(ShelfView); |
| 57 }; |
| 58 |
| 59 } // namespace shelf |
| 60 } // namespace mash |
| 61 |
| 62 #endif // MASH_SHELF_SHELF_VIEW_H_ |
OLD | NEW |