Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: ash/autoclick/mus/autoclick_application.cc

Issue 2539363005: Converts ash to use aura-mus (Closed)
Patch Set: add overrides Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/autoclick/mus/BUILD.gn ('k') | ash/common/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/cpp/shell_window_ids.h" 7 #include "ash/public/cpp/shell_window_ids.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "services/service_manager/public/cpp/connector.h" 11 #include "services/service_manager/public/cpp/connector.h"
12 #include "services/service_manager/public/cpp/service_context.h" 12 #include "services/service_manager/public/cpp/service_context.h"
13 #include "services/ui/public/cpp/property_type_converters.h" 13 #include "services/ui/public/cpp/property_type_converters.h"
14 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 14 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
15 #include "ui/aura/mus/property_converter.h"
15 #include "ui/views/mus/aura_init.h" 16 #include "ui/views/mus/aura_init.h"
16 #include "ui/views/mus/native_widget_mus.h" 17 #include "ui/views/mus/native_widget_mus.h"
17 #include "ui/views/mus/pointer_watcher_event_router.h" 18 #include "ui/views/mus/pointer_watcher_event_router.h"
18 #include "ui/views/mus/window_manager_connection.h" 19 #include "ui/views/mus/window_manager_connection.h"
19 #include "ui/views/pointer_watcher.h" 20 #include "ui/views/pointer_watcher.h"
20 #include "ui/views/widget/widget.h" 21 #include "ui/views/widget/widget.h"
21 #include "ui/views/widget/widget_delegate.h" 22 #include "ui/views/widget/widget_delegate.h"
22 23
23 namespace ash { 24 namespace ash {
24 namespace autoclick { 25 namespace autoclick {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 params.accept_events = false; 106 params.accept_events = false;
106 params.delegate = new AutoclickUI(window_manager_connection_.get(), 107 params.delegate = new AutoclickUI(window_manager_connection_.get(),
107 autoclick_controller_common_.get()); 108 autoclick_controller_common_.get());
108 109
109 std::map<std::string, std::vector<uint8_t>> properties; 110 std::map<std::string, std::vector<uint8_t>> properties;
110 properties[ui::mojom::WindowManager::kInitialContainerId_Property] = 111 properties[ui::mojom::WindowManager::kInitialContainerId_Property] =
111 mojo::ConvertTo<std::vector<uint8_t>>( 112 mojo::ConvertTo<std::vector<uint8_t>>(
112 ash::kShellWindowId_OverlayContainer); 113 ash::kShellWindowId_OverlayContainer);
113 properties[ui::mojom::WindowManager::kShowState_Property] = 114 properties[ui::mojom::WindowManager::kShowState_Property] =
114 mojo::ConvertTo<std::vector<uint8_t>>( 115 mojo::ConvertTo<std::vector<uint8_t>>(
115 static_cast<int32_t>(ui::mojom::ShowState::FULLSCREEN)); 116 static_cast<aura::PropertyConverter::PrimitiveType>(
117 ui::mojom::ShowState::FULLSCREEN));
116 ui::Window* window = 118 ui::Window* window =
117 window_manager_connection_.get()->NewTopLevelWindow(properties); 119 window_manager_connection_.get()->NewTopLevelWindow(properties);
118 params.native_widget = new views::NativeWidgetMus( 120 params.native_widget = new views::NativeWidgetMus(
119 widget_.get(), window, ui::mojom::CompositorFrameSinkType::DEFAULT); 121 widget_.get(), window, ui::mojom::CompositorFrameSinkType::DEFAULT);
120 widget_->Init(params); 122 widget_->Init(params);
121 } else { 123 } else {
122 widget_->Close(); 124 widget_->Close();
123 base::MessageLoop::current()->QuitWhenIdle(); 125 base::MessageLoop::current()->QuitWhenIdle();
124 } 126 }
125 } 127 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // TODO(riajiang): Currently not working. Need to know how to generate events 161 // TODO(riajiang): Currently not working. Need to know how to generate events
160 // in mus world (crbug.com/628665). 162 // in mus world (crbug.com/628665).
161 } 163 }
162 164
163 void AutoclickApplication::OnAutoclickCanceled() { 165 void AutoclickApplication::OnAutoclickCanceled() {
164 // Not used in mus. 166 // Not used in mus.
165 } 167 }
166 168
167 } // namespace autoclick 169 } // namespace autoclick
168 } // namespace ash 170 } // namespace ash
OLDNEW
« no previous file with comments | « ash/autoclick/mus/BUILD.gn ('k') | ash/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698