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

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

Issue 2669203002: Revert: Remove WindowTreeClientDelegate::GetCaptureClient() and WindowTreeClient::GetCaptureClient() (Closed)
Patch Set: Created 3 years, 10 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/mus_client.h ('k') | no next file » | 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 "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "components/discardable_memory/client/client_discardable_shared_memory_ manager.h" 10 #include "components/discardable_memory/client/client_discardable_shared_memory_ manager.h"
(...skipping 15 matching lines...) Expand all
26 #include "ui/aura/window_tree_host.h" 26 #include "ui/aura/window_tree_host.h"
27 #include "ui/views/mus/aura_init.h" 27 #include "ui/views/mus/aura_init.h"
28 #include "ui/views/mus/clipboard_mus.h" 28 #include "ui/views/mus/clipboard_mus.h"
29 #include "ui/views/mus/desktop_window_tree_host_mus.h" 29 #include "ui/views/mus/desktop_window_tree_host_mus.h"
30 #include "ui/views/mus/mus_property_mirror.h" 30 #include "ui/views/mus/mus_property_mirror.h"
31 #include "ui/views/mus/pointer_watcher_event_router.h" 31 #include "ui/views/mus/pointer_watcher_event_router.h"
32 #include "ui/views/mus/screen_mus.h" 32 #include "ui/views/mus/screen_mus.h"
33 #include "ui/views/views_delegate.h" 33 #include "ui/views/views_delegate.h"
34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" 34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
35 #include "ui/views/widget/widget_delegate.h" 35 #include "ui/views/widget/widget_delegate.h"
36 #include "ui/wm/core/capture_controller.h"
36 #include "ui/wm/core/wm_state.h" 37 #include "ui/wm/core/wm_state.h"
37 38
38 // Widget::InitParams::Type must match that of ui::mojom::WindowType. 39 // Widget::InitParams::Type must match that of ui::mojom::WindowType.
39 #define WINDOW_TYPES_MATCH(NAME) \ 40 #define WINDOW_TYPES_MATCH(NAME) \
40 static_assert( \ 41 static_assert( \
41 static_cast<int32_t>(views::Widget::InitParams::TYPE_##NAME) == \ 42 static_cast<int32_t>(views::Widget::InitParams::TYPE_##NAME) == \
42 static_cast<int32_t>(ui::mojom::WindowType::NAME), \ 43 static_cast<int32_t>(ui::mojom::WindowType::NAME), \
43 "Window type constants must match") 44 "Window type constants must match")
44 45
45 WINDOW_TYPES_MATCH(WINDOW); 46 WINDOW_TYPES_MATCH(WINDOW);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 void MusClient::OnPointerEventObserved(const ui::PointerEvent& event, 265 void MusClient::OnPointerEventObserved(const ui::PointerEvent& event,
265 aura::Window* target) { 266 aura::Window* target) {
266 pointer_watcher_event_router_->OnPointerEventObserved(event, target); 267 pointer_watcher_event_router_->OnPointerEventObserved(event, target);
267 } 268 }
268 269
269 void MusClient::OnWindowManagerFrameValuesChanged() { 270 void MusClient::OnWindowManagerFrameValuesChanged() {
270 for (auto& observer : observer_list_) 271 for (auto& observer : observer_list_)
271 observer.OnWindowManagerFrameValuesChanged(); 272 observer.OnWindowManagerFrameValuesChanged();
272 } 273 }
273 274
275 aura::client::CaptureClient* MusClient::GetCaptureClient() {
276 return wm::CaptureController::Get();
277 }
278
274 aura::PropertyConverter* MusClient::GetPropertyConverter() { 279 aura::PropertyConverter* MusClient::GetPropertyConverter() {
275 return property_converter_.get(); 280 return property_converter_.get();
276 } 281 }
277 282
278 aura::Window* MusClient::GetWindowAtScreenPoint(const gfx::Point& point) { 283 aura::Window* MusClient::GetWindowAtScreenPoint(const gfx::Point& point) {
279 for (aura::Window* root : window_tree_client_->GetRoots()) { 284 for (aura::Window* root : window_tree_client_->GetRoots()) {
280 aura::WindowTreeHost* window_tree_host = root->GetHost(); 285 aura::WindowTreeHost* window_tree_host = root->GetHost();
281 if (!window_tree_host) 286 if (!window_tree_host)
282 continue; 287 continue;
283 // TODO: this likely gets z-order wrong. http://crbug.com/663606. 288 // TODO: this likely gets z-order wrong. http://crbug.com/663606.
284 gfx::Point relative_point(point); 289 gfx::Point relative_point(point);
285 window_tree_host->ConvertScreenInPixelsToDIP(&relative_point); 290 window_tree_host->ConvertScreenInPixelsToDIP(&relative_point);
286 if (gfx::Rect(root->bounds().size()).Contains(relative_point)) 291 if (gfx::Rect(root->bounds().size()).Contains(relative_point))
287 return root->GetTopWindowContainingPoint(relative_point); 292 return root->GetTopWindowContainingPoint(relative_point);
288 } 293 }
289 return nullptr; 294 return nullptr;
290 } 295 }
291 296
292 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { 297 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() {
293 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); 298 return base::MakeUnique<aura::OSExchangeDataProviderMus>();
294 } 299 }
295 300
296 } // namespace views 301 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/mus_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698