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 COMPONENTS_MUS_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ | |
6 #define COMPONENTS_MUS_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "components/mus/public/cpp/window_tree_delegate.h" | |
10 #include "components/mus/public/interfaces/window_manager.mojom.h" | |
11 #include "ui/views/mus/aura_init.h" | |
12 #include "ui/views/views_delegate.h" | |
13 | |
14 namespace mojo { | |
15 class ApplicationImpl; | |
16 } | |
17 | |
18 namespace views { | |
19 class AuraInit; | |
20 } | |
21 | |
22 // Does the necessary setup to use mus, views and the example wm. | |
23 class MUSViewsInit : public views::ViewsDelegate, | |
24 public mus::WindowTreeDelegate { | |
25 public: | |
26 explicit MUSViewsInit(mojo::ApplicationImpl* app); | |
27 ~MUSViewsInit() override; | |
28 | |
29 private: | |
30 mus::Window* NewWindow(); | |
31 | |
32 // views::ViewsDelegate: | |
33 views::NativeWidget* CreateNativeWidget( | |
34 views::internal::NativeWidgetDelegate* delegate) override; | |
35 void OnBeforeWidgetInit( | |
36 views::Widget::InitParams* params, | |
37 views::internal::NativeWidgetDelegate* delegate) override; | |
38 | |
39 // mus::WindowTreeDelegate: | |
40 void OnEmbed(mus::Window* root) override; | |
41 void OnConnectionLost(mus::WindowTreeConnection* connection) override; | |
42 #if defined(OS_WIN) | |
43 HICON GetSmallWindowIcon() const override; | |
44 #endif | |
45 | |
46 mojo::ApplicationImpl* app_; | |
47 scoped_ptr<views::AuraInit> aura_init_; | |
48 mus::mojom::WindowManagerPtr window_manager_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(MUSViewsInit); | |
51 }; | |
52 | |
53 #endif // COMPONENTS_MUS_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ | |
OLD | NEW |