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/autoclick/mus/autoclick_application.h" | 5 #include "ash/autoclick/mus/autoclick_application.h" |
6 | 6 |
7 #include "ash/public/interfaces/container.mojom.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
11 #include "services/ui/public/cpp/property_type_converters.h" | 11 #include "services/ui/public/cpp/property_type_converters.h" |
12 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 12 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
13 #include "ui/views/mus/aura_init.h" | 13 #include "ui/views/mus/aura_init.h" |
14 #include "ui/views/mus/native_widget_mus.h" | 14 #include "ui/views/mus/native_widget_mus.h" |
15 #include "ui/views/mus/pointer_watcher_event_router.h" | 15 #include "ui/views/mus/pointer_watcher_event_router.h" |
16 #include "ui/views/mus/window_manager_connection.h" | 16 #include "ui/views/mus/window_manager_connection.h" |
17 #include "ui/views/pointer_watcher.h" | 17 #include "ui/views/pointer_watcher.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 views::Widget::InitParams params( | 97 views::Widget::InitParams params( |
98 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 98 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
99 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 99 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
100 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 100 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
101 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 101 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; |
102 params.accept_events = false; | 102 params.accept_events = false; |
103 params.delegate = new AutoclickUI(window_manager_connection_.get(), | 103 params.delegate = new AutoclickUI(window_manager_connection_.get(), |
104 autoclick_controller_common_.get()); | 104 autoclick_controller_common_.get()); |
105 | 105 |
106 std::map<std::string, std::vector<uint8_t>> properties; | 106 std::map<std::string, std::vector<uint8_t>> properties; |
107 properties[ash::mojom::kWindowContainer_Property] = | 107 properties[ui::mojom::WindowManager::kInitialContainerId_Property] = |
108 mojo::ConvertTo<std::vector<uint8_t>>( | 108 mojo::ConvertTo<std::vector<uint8_t>>( |
109 static_cast<int32_t>(ash::mojom::Container::OVERLAY)); | 109 ash::kShellWindowId_OverlayContainer); |
110 properties[ui::mojom::WindowManager::kShowState_Property] = | 110 properties[ui::mojom::WindowManager::kShowState_Property] = |
111 mojo::ConvertTo<std::vector<uint8_t>>( | 111 mojo::ConvertTo<std::vector<uint8_t>>( |
112 static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN)); | 112 static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN)); |
113 ui::Window* window = | 113 ui::Window* window = |
114 window_manager_connection_.get()->NewTopLevelWindow(properties); | 114 window_manager_connection_.get()->NewTopLevelWindow(properties); |
115 params.native_widget = new views::NativeWidgetMus( | 115 params.native_widget = new views::NativeWidgetMus( |
116 widget_.get(), window, ui::mojom::SurfaceType::DEFAULT); | 116 widget_.get(), window, ui::mojom::SurfaceType::DEFAULT); |
117 widget_->Init(params); | 117 widget_->Init(params); |
118 } else { | 118 } else { |
119 widget_->Close(); | 119 widget_->Close(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // TODO(riajiang): Currently not working. Need to know how to generate events | 156 // TODO(riajiang): Currently not working. Need to know how to generate events |
157 // in mus world (crbug.com/628665). | 157 // in mus world (crbug.com/628665). |
158 } | 158 } |
159 | 159 |
160 void AutoclickApplication::OnAutoclickCanceled() { | 160 void AutoclickApplication::OnAutoclickCanceled() { |
161 // Not used in mus. | 161 // Not used in mus. |
162 } | 162 } |
163 | 163 |
164 } // namespace autoclick | 164 } // namespace autoclick |
165 } // namespace ash | 165 } // namespace ash |
OLD | NEW |