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

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

Issue 2507963002: Implement hit tests/client area. (Closed)
Patch Set: add it back 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 | « ui/views/mus/mus_client.h ('k') | ui/views/mus/mus_client_observer.h » ('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 "ui/views/mus/mus_client.h" 5 #include "ui/views/mus/mus_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "services/service_manager/public/cpp/connection.h" 9 #include "services/service_manager/public/cpp/connection.h"
10 #include "services/service_manager/public/cpp/connector.h" 10 #include "services/service_manager/public/cpp/connector.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } else { 108 } else {
109 std::map<std::string, std::vector<uint8_t>> mus_properties = 109 std::map<std::string, std::vector<uint8_t>> mus_properties =
110 ConfigurePropertiesFromParams(init_params); 110 ConfigurePropertiesFromParams(init_params);
111 native_widget->SetDesktopWindowTreeHost( 111 native_widget->SetDesktopWindowTreeHost(
112 base::MakeUnique<DesktopWindowTreeHostMus>(delegate, native_widget, 112 base::MakeUnique<DesktopWindowTreeHostMus>(delegate, native_widget,
113 &mus_properties)); 113 &mus_properties));
114 } 114 }
115 return native_widget; 115 return native_widget;
116 } 116 }
117 117
118 void MusClient::AddObserver(MusClientObserver* observer) {
119 observer_list_.AddObserver(observer);
120 }
121
122 void MusClient::RemoveObserver(MusClientObserver* observer) {
123 observer_list_.RemoveObserver(observer);
124 }
125
118 MusClient::MusClient(service_manager::Connector* connector, 126 MusClient::MusClient(service_manager::Connector* connector,
119 const service_manager::Identity& identity, 127 const service_manager::Identity& identity,
120 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) 128 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
121 : connector_(connector), identity_(identity) { 129 : connector_(connector), identity_(identity) {
122 DCHECK(!instance_); 130 DCHECK(!instance_);
123 instance_ = this; 131 instance_ = this;
124 // TODO(msw): Avoid this... use some default value? Allow clients to extend? 132 // TODO(msw): Avoid this... use some default value? Allow clients to extend?
125 property_converter_ = base::MakeUnique<aura::PropertyConverter>(); 133 property_converter_ = base::MakeUnique<aura::PropertyConverter>();
126 134
127 wm_state_ = base::MakeUnique<wm::WMState>(); 135 wm_state_ = base::MakeUnique<wm::WMState>();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // way of an Embed(). 172 // way of an Embed().
165 NOTREACHED(); 173 NOTREACHED();
166 } 174 }
167 175
168 void MusClient::OnPointerEventObserved(const ui::PointerEvent& event, 176 void MusClient::OnPointerEventObserved(const ui::PointerEvent& event,
169 aura::Window* target) { 177 aura::Window* target) {
170 pointer_watcher_event_router_->OnPointerEventObserved(event, target); 178 pointer_watcher_event_router_->OnPointerEventObserved(event, target);
171 } 179 }
172 180
173 void MusClient::OnWindowManagerFrameValuesChanged() { 181 void MusClient::OnWindowManagerFrameValuesChanged() {
174 // TODO: wire up client area. http://crbug.com/663525. 182 for (auto& observer : observer_list_)
175 NOTIMPLEMENTED(); 183 observer.OnWindowManagerFrameValuesChanged();
176 } 184 }
177 185
178 aura::client::CaptureClient* MusClient::GetCaptureClient() { 186 aura::client::CaptureClient* MusClient::GetCaptureClient() {
179 return wm::CaptureController::Get(); 187 return wm::CaptureController::Get();
180 } 188 }
181 189
182 aura::PropertyConverter* MusClient::GetPropertyConverter() { 190 aura::PropertyConverter* MusClient::GetPropertyConverter() {
183 return property_converter_.get(); 191 return property_converter_.get();
184 } 192 }
185 193
(...skipping 13 matching lines...) Expand all
199 return root->GetTopWindowContainingPoint(relative_point); 207 return root->GetTopWindowContainingPoint(relative_point);
200 } 208 }
201 return nullptr; 209 return nullptr;
202 } 210 }
203 211
204 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { 212 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() {
205 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); 213 return base::MakeUnique<aura::OSExchangeDataProviderMus>();
206 } 214 }
207 215
208 } // namespace views 216 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/mus_client.h ('k') | ui/views/mus/mus_client_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698