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

Side by Side Diff: ui/views/mus/window_manager_connection.cc

Issue 2018333002: views/mus: Add support for child widgets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 months 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 | « ui/views/mus/BUILD.gn ('k') | ui/views/widget/native_widget_aura.cc » ('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 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 #include "ui/views/mus/window_manager_connection.h" 5 #include "ui/views/mus/window_manager_connection.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 mus::Window* WindowManagerConnection::NewWindow( 62 mus::Window* WindowManagerConnection::NewWindow(
63 const std::map<std::string, std::vector<uint8_t>>& properties) { 63 const std::map<std::string, std::vector<uint8_t>>& properties) {
64 return window_tree_connection_->NewTopLevelWindow(&properties); 64 return window_tree_connection_->NewTopLevelWindow(&properties);
65 } 65 }
66 66
67 NativeWidget* WindowManagerConnection::CreateNativeWidgetMus( 67 NativeWidget* WindowManagerConnection::CreateNativeWidgetMus(
68 const std::map<std::string, std::vector<uint8_t>>& props, 68 const std::map<std::string, std::vector<uint8_t>>& props,
69 const Widget::InitParams& init_params, 69 const Widget::InitParams& init_params,
70 internal::NativeWidgetDelegate* delegate) { 70 internal::NativeWidgetDelegate* delegate) {
71 // TYPE_CONTROL widgets require a NativeWidgetAura. So we let this fall
72 // through, so that the default NativeWidgetPrivate::CreateNativeWidget() is
73 // used instead.
74 if (init_params.type == Widget::InitParams::TYPE_CONTROL)
75 return nullptr;
71 std::map<std::string, std::vector<uint8_t>> properties = props; 76 std::map<std::string, std::vector<uint8_t>> properties = props;
72 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); 77 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties);
73 properties[mus::mojom::WindowManager::kAppID_Property] = 78 properties[mus::mojom::WindowManager::kAppID_Property] =
74 mojo::ConvertTo<std::vector<uint8_t>>(identity_.name()); 79 mojo::ConvertTo<std::vector<uint8_t>>(identity_.name());
75 return new NativeWidgetMus(delegate, connector_, NewWindow(properties), 80 return new NativeWidgetMus(delegate, connector_, NewWindow(properties),
76 mus::mojom::SurfaceType::DEFAULT); 81 mus::mojom::SurfaceType::DEFAULT);
77 } 82 }
78 83
79 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) { 84 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) {
80 bool had_watcher = HasPointerWatcher(); 85 bool had_watcher = HasPointerWatcher();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { 174 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() {
170 if (window_tree_connection_) 175 if (window_tree_connection_)
171 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get()); 176 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get());
172 } 177 }
173 178
174 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { 179 gfx::Point WindowManagerConnection::GetCursorScreenPoint() {
175 return window_tree_connection_->GetCursorScreenPoint(); 180 return window_tree_connection_->GetCursorScreenPoint();
176 } 181 }
177 182
178 } // namespace views 183 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/BUILD.gn ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698