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