| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "ash/touch_hud/mus/touch_hud_application.h" | 5 #include "ash/touch_hud/mus/touch_hud_application.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "ash/touch_hud/touch_hud_renderer.h" | 8 #include "ash/touch_hud/touch_hud_renderer.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "services/service_manager/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" |
| 13 #include "services/service_manager/public/cpp/interface_registry.h" | 13 #include "services/service_manager/public/cpp/interface_registry.h" |
| 14 #include "services/service_manager/public/cpp/service_context.h" | 14 #include "services/service_manager/public/cpp/service_context.h" |
| 15 #include "services/ui/public/cpp/property_type_converters.h" | 15 #include "services/ui/public/cpp/property_type_converters.h" |
| 16 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 16 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 17 #include "ui/aura/mus/property_converter.h" |
| 17 #include "ui/views/mus/aura_init.h" | 18 #include "ui/views/mus/aura_init.h" |
| 18 #include "ui/views/mus/native_widget_mus.h" | 19 #include "ui/views/mus/native_widget_mus.h" |
| 19 #include "ui/views/mus/pointer_watcher_event_router.h" | 20 #include "ui/views/mus/pointer_watcher_event_router.h" |
| 20 #include "ui/views/mus/window_manager_connection.h" | 21 #include "ui/views/mus/window_manager_connection.h" |
| 21 #include "ui/views/pointer_watcher.h" | 22 #include "ui/views/pointer_watcher.h" |
| 22 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
| 23 #include "ui/views/widget/widget_delegate.h" | 24 #include "ui/views/widget/widget_delegate.h" |
| 24 | 25 |
| 25 namespace ash { | 26 namespace ash { |
| 26 namespace touch_hud { | 27 namespace touch_hud { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 91 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
| 91 params.accept_events = false; | 92 params.accept_events = false; |
| 92 params.delegate = new TouchHudUI(window_manager_connection_.get(), widget_); | 93 params.delegate = new TouchHudUI(window_manager_connection_.get(), widget_); |
| 93 | 94 |
| 94 std::map<std::string, std::vector<uint8_t>> properties; | 95 std::map<std::string, std::vector<uint8_t>> properties; |
| 95 properties[ui::mojom::WindowManager::kInitialContainerId_Property] = | 96 properties[ui::mojom::WindowManager::kInitialContainerId_Property] = |
| 96 mojo::ConvertTo<std::vector<uint8_t>>( | 97 mojo::ConvertTo<std::vector<uint8_t>>( |
| 97 ash::kShellWindowId_OverlayContainer); | 98 ash::kShellWindowId_OverlayContainer); |
| 98 properties[ui::mojom::WindowManager::kShowState_Property] = | 99 properties[ui::mojom::WindowManager::kShowState_Property] = |
| 99 mojo::ConvertTo<std::vector<uint8_t>>( | 100 mojo::ConvertTo<std::vector<uint8_t>>( |
| 100 static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN)); | 101 static_cast<aura::PropertyConverter::PrimitiveType>( |
| 102 ui::mojom::ShowState::FULLSCREEN)); |
| 101 ui::Window* window = | 103 ui::Window* window = |
| 102 window_manager_connection_.get()->NewTopLevelWindow(properties); | 104 window_manager_connection_.get()->NewTopLevelWindow(properties); |
| 103 params.native_widget = new views::NativeWidgetMus( | 105 params.native_widget = new views::NativeWidgetMus( |
| 104 widget_, window, ui::mojom::CompositorFrameSinkType::DEFAULT); | 106 widget_, window, ui::mojom::CompositorFrameSinkType::DEFAULT); |
| 105 widget_->Init(params); | 107 widget_->Init(params); |
| 106 widget_->Show(); | 108 widget_->Show(); |
| 107 } else { | 109 } else { |
| 108 widget_->Close(); | 110 widget_->Close(); |
| 109 base::MessageLoop::current()->QuitWhenIdle(); | 111 base::MessageLoop::current()->QuitWhenIdle(); |
| 110 } | 112 } |
| 111 } | 113 } |
| 112 | 114 |
| 113 void TouchHudApplication::Create( | 115 void TouchHudApplication::Create( |
| 114 const service_manager::Identity& remote_identity, | 116 const service_manager::Identity& remote_identity, |
| 115 mash::mojom::LaunchableRequest request) { | 117 mash::mojom::LaunchableRequest request) { |
| 116 binding_.Close(); | 118 binding_.Close(); |
| 117 binding_.Bind(std::move(request)); | 119 binding_.Bind(std::move(request)); |
| 118 } | 120 } |
| 119 | 121 |
| 120 } // namespace touch_hud | 122 } // namespace touch_hud |
| 121 } // namespace ash | 123 } // namespace ash |
| OLD | NEW |