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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « mash/shelf/shelf_application.cc ('k') | mash/shelf/shelf_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« 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