OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ | 5 #ifndef MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ |
6 #define MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ | 6 #define MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "components/mus/public/cpp/window_tree_delegate.h" | 10 #include "components/mus/public/cpp/window_tree_delegate.h" |
11 #include "components/mus/public/interfaces/window_manager.mojom.h" | 11 #include "components/mus/public/interfaces/window_manager.mojom.h" |
12 #include "ui/views/mus/aura_init.h" | 12 #include "ui/views/mus/aura_init.h" |
13 #include "ui/views/views_delegate.h" | 13 #include "ui/views/views_delegate.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 class ApplicationImpl; | 16 class ShellConnection; |
17 } | 17 } |
18 | 18 |
19 namespace views { | 19 namespace views { |
20 class AuraInit; | 20 class AuraInit; |
21 } | 21 } |
22 | 22 |
23 // Does the necessary setup to use mus, views and the example wm. | 23 // Does the necessary setup to use mus, views and the example wm. |
24 class MUSViewsInit : public views::ViewsDelegate, | 24 class MUSViewsInit : public views::ViewsDelegate, |
25 public mus::WindowTreeDelegate { | 25 public mus::WindowTreeDelegate { |
26 public: | 26 public: |
27 explicit MUSViewsInit(mojo::ApplicationImpl* app); | 27 explicit MUSViewsInit(mojo::ShellConnection* app); |
28 ~MUSViewsInit() override; | 28 ~MUSViewsInit() override; |
29 | 29 |
30 private: | 30 private: |
31 mus::Window* NewWindow(); | 31 mus::Window* NewWindow(); |
32 | 32 |
33 // views::ViewsDelegate: | 33 // views::ViewsDelegate: |
34 views::NativeWidget* CreateNativeWidget( | 34 views::NativeWidget* CreateNativeWidget( |
35 views::internal::NativeWidgetDelegate* delegate) override; | 35 views::internal::NativeWidgetDelegate* delegate) override; |
36 void OnBeforeWidgetInit( | 36 void OnBeforeWidgetInit( |
37 views::Widget::InitParams* params, | 37 views::Widget::InitParams* params, |
38 views::internal::NativeWidgetDelegate* delegate) override; | 38 views::internal::NativeWidgetDelegate* delegate) override; |
39 | 39 |
40 // mus::WindowTreeDelegate: | 40 // mus::WindowTreeDelegate: |
41 void OnEmbed(mus::Window* root) override; | 41 void OnEmbed(mus::Window* root) override; |
42 void OnConnectionLost(mus::WindowTreeConnection* connection) override; | 42 void OnConnectionLost(mus::WindowTreeConnection* connection) override; |
43 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
44 HICON GetSmallWindowIcon() const override; | 44 HICON GetSmallWindowIcon() const override; |
45 #endif | 45 #endif |
46 | 46 |
47 mojo::ApplicationImpl* app_; | 47 mojo::ShellConnection* app_; |
48 scoped_ptr<views::AuraInit> aura_init_; | 48 scoped_ptr<views::AuraInit> aura_init_; |
49 mus::mojom::WindowManagerPtr window_manager_; | 49 mus::mojom::WindowManagerPtr window_manager_; |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(MUSViewsInit); | 51 DISALLOW_COPY_AND_ASSIGN(MUSViewsInit); |
52 }; | 52 }; |
53 | 53 |
54 #endif // MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ | 54 #endif // MASH_EXAMPLE_COMMON_MUS_VIEWS_INIT_H_ |
OLD | NEW |