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

Side by Side Diff: ui/aura/mus/window_tree_client.cc

Issue 2823903005: Extracts parameters to WindowTreeHostMus into structure (Closed)
Patch Set: move constructor Created 3 years, 8 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/aura/BUILD.gn ('k') | ui/aura/mus/window_tree_client_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/aura/mus/window_tree_client.h" 5 #include "ui/aura/mus/window_tree_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 26 matching lines...) Expand all
37 #include "ui/aura/mus/mus_context_factory.h" 37 #include "ui/aura/mus/mus_context_factory.h"
38 #include "ui/aura/mus/property_converter.h" 38 #include "ui/aura/mus/property_converter.h"
39 #include "ui/aura/mus/property_utils.h" 39 #include "ui/aura/mus/property_utils.h"
40 #include "ui/aura/mus/window_manager_delegate.h" 40 #include "ui/aura/mus/window_manager_delegate.h"
41 #include "ui/aura/mus/window_mus.h" 41 #include "ui/aura/mus/window_mus.h"
42 #include "ui/aura/mus/window_port_mus.h" 42 #include "ui/aura/mus/window_port_mus.h"
43 #include "ui/aura/mus/window_tree_client_delegate.h" 43 #include "ui/aura/mus/window_tree_client_delegate.h"
44 #include "ui/aura/mus/window_tree_client_observer.h" 44 #include "ui/aura/mus/window_tree_client_observer.h"
45 #include "ui/aura/mus/window_tree_client_test_observer.h" 45 #include "ui/aura/mus/window_tree_client_test_observer.h"
46 #include "ui/aura/mus/window_tree_host_mus.h" 46 #include "ui/aura/mus/window_tree_host_mus.h"
47 #include "ui/aura/mus/window_tree_host_mus_init_params.h"
47 #include "ui/aura/window.h" 48 #include "ui/aura/window.h"
48 #include "ui/aura/window_delegate.h" 49 #include "ui/aura/window_delegate.h"
49 #include "ui/aura/window_tracker.h" 50 #include "ui/aura/window_tracker.h"
50 #include "ui/base/layout.h" 51 #include "ui/base/layout.h"
51 #include "ui/base/ui_base_types.h" 52 #include "ui/base/ui_base_types.h"
52 #include "ui/display/screen.h" 53 #include "ui/display/screen.h"
53 #include "ui/events/event.h" 54 #include "ui/events/event.h"
54 #include "ui/gfx/geometry/dip_util.h" 55 #include "ui/gfx/geometry/dip_util.h"
55 #include "ui/gfx/geometry/insets.h" 56 #include "ui/gfx/geometry/insets.h"
56 #include "ui/gfx/geometry/size.h" 57 #include "ui/gfx/geometry/size.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 110 }
110 111
111 private: 112 private:
112 std::unique_ptr<EventResultCallback> ack_callback_; 113 std::unique_ptr<EventResultCallback> ack_callback_;
113 bool handled_ = false; 114 bool handled_ = false;
114 115
115 DISALLOW_COPY_AND_ASSIGN(EventAckHandler); 116 DISALLOW_COPY_AND_ASSIGN(EventAckHandler);
116 }; 117 };
117 118
118 WindowTreeHostMus* GetWindowTreeHostMus(Window* window) { 119 WindowTreeHostMus* GetWindowTreeHostMus(Window* window) {
119 return static_cast<WindowTreeHostMus*>(window->GetRootWindow()->GetHost()); 120 return WindowTreeHostMus::ForWindow(window);
120 } 121 }
121 122
122 WindowTreeHostMus* GetWindowTreeHostMus(WindowMus* window) { 123 WindowTreeHostMus* GetWindowTreeHostMus(WindowMus* window) {
123 return GetWindowTreeHostMus(window->GetWindow()); 124 return GetWindowTreeHostMus(window->GetWindow());
124 } 125 }
125 126
126 bool IsInternalProperty(const void* key) { 127 bool IsInternalProperty(const void* key) {
127 return key == client::kModalKey; 128 return key == client::kModalKey;
128 } 129 }
129 130
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 459
459 std::unique_ptr<WindowTreeHostMus> WindowTreeClient::CreateWindowTreeHost( 460 std::unique_ptr<WindowTreeHostMus> WindowTreeClient::CreateWindowTreeHost(
460 WindowMusType window_mus_type, 461 WindowMusType window_mus_type,
461 const ui::mojom::WindowData& window_data, 462 const ui::mojom::WindowData& window_data,
462 int64_t display_id, 463 int64_t display_id,
463 const cc::FrameSinkId& frame_sink_id, 464 const cc::FrameSinkId& frame_sink_id,
464 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { 465 const base::Optional<cc::LocalSurfaceId>& local_surface_id) {
465 std::unique_ptr<WindowPortMus> window_port = 466 std::unique_ptr<WindowPortMus> window_port =
466 CreateWindowPortMus(window_data, window_mus_type); 467 CreateWindowPortMus(window_data, window_mus_type);
467 roots_.insert(window_port.get()); 468 roots_.insert(window_port.get());
469 WindowTreeHostMusInitParams init_params;
470 init_params.window_port = std::move(window_port);
471 init_params.window_tree_client = this;
472 init_params.display_id = display_id;
473 init_params.frame_sink_id = frame_sink_id;
468 std::unique_ptr<WindowTreeHostMus> window_tree_host = 474 std::unique_ptr<WindowTreeHostMus> window_tree_host =
469 base::MakeUnique<WindowTreeHostMus>(std::move(window_port), this, 475 base::MakeUnique<WindowTreeHostMus>(std::move(init_params));
470 display_id, frame_sink_id);
471 window_tree_host->InitHost(); 476 window_tree_host->InitHost();
472 SetLocalPropertiesFromServerProperties( 477 SetLocalPropertiesFromServerProperties(
473 WindowMus::Get(window_tree_host->window()), window_data); 478 WindowMus::Get(window_tree_host->window()), window_data);
474 if (window_data.visible) { 479 if (window_data.visible) {
475 SetWindowVisibleFromServer(WindowMus::Get(window_tree_host->window()), 480 SetWindowVisibleFromServer(WindowMus::Get(window_tree_host->window()),
476 true); 481 true);
477 } 482 }
478 WindowMus* window = WindowMus::Get(window_tree_host->window()); 483 WindowMus* window = WindowMus::Get(window_tree_host->window());
479 484
480 SetWindowBoundsFromServer(window, window_data.bounds, local_surface_id); 485 SetWindowBoundsFromServer(window, window_data.bounds, local_surface_id);
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( 1970 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>(
1966 this, capture_synchronizer_.get(), window)); 1971 this, capture_synchronizer_.get(), window));
1967 } 1972 }
1968 1973
1969 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { 1974 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) {
1970 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( 1975 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>(
1971 this, focus_synchronizer_.get(), window)); 1976 this, focus_synchronizer_.get(), window));
1972 } 1977 }
1973 1978
1974 } // namespace aura 1979 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/BUILD.gn ('k') | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698