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

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

Issue 2833093002: WIP: simplified display management in ash (Closed)
Patch Set: x 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 | « services/ui/ws/window_server.cc ('k') | ui/aura/window_tree_host.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 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 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 WindowMus* window = GetWindowByServerId(window_id); 1460 WindowMus* window = GetWindowByServerId(window_id);
1461 if (!window || !IsRoot(window)) 1461 if (!window || !IsRoot(window))
1462 return; 1462 return;
1463 1463
1464 // Since the window is the root window, we send close request to the entire 1464 // Since the window is the root window, we send close request to the entire
1465 // WindowTreeHost. 1465 // WindowTreeHost.
1466 GetWindowTreeHostMus(window->GetWindow())->OnCloseRequest(); 1466 GetWindowTreeHostMus(window->GetWindow())->OnCloseRequest();
1467 } 1467 }
1468 1468
1469 bool WindowTreeClient::WaitForInitialDisplays() { 1469 bool WindowTreeClient::WaitForInitialDisplays() {
1470 LOG(WARNING) << "WaitForInitialDisplays got=" << got_initial_displays_;
1470 if (got_initial_displays_) 1471 if (got_initial_displays_)
1471 return true; 1472 return true;
1472 1473
1473 bool valid_wait = true; 1474 bool valid_wait = true;
1474 // TODO(sky): having to block here is not ideal. http://crbug.com/594852. 1475 // TODO(sky): having to block here is not ideal. http://crbug.com/594852.
1475 while (!got_initial_displays_ && valid_wait) 1476 while (!got_initial_displays_ && valid_wait)
1476 valid_wait = binding_.WaitForIncomingMethodCall(); 1477 valid_wait = binding_.WaitForIncomingMethodCall();
1478 LOG(WARNING) << "wait done, valid=" << valid_wait;
1477 return valid_wait; 1479 return valid_wait;
1478 } 1480 }
1479 1481
1480 WindowTreeHostMusInitParams WindowTreeClient::CreateInitParamsForNewDisplay() { 1482 WindowTreeHostMusInitParams WindowTreeClient::CreateInitParamsForNewDisplay() {
1481 WindowTreeHostMusInitParams init_params; 1483 WindowTreeHostMusInitParams init_params;
1482 init_params.window_port = base::MakeUnique<WindowPortMus>( 1484 init_params.window_port = base::MakeUnique<WindowPortMus>(
1483 this, WindowMusType::DISPLAY_MANUALLY_CREATED); 1485 this, WindowMusType::DISPLAY_MANUALLY_CREATED);
1484 roots_.insert(init_params.window_port.get()); 1486 roots_.insert(init_params.window_port.get());
1485 init_params.window_tree_client = this; 1487 init_params.window_tree_client = this;
1486 return init_params; 1488 return init_params;
1487 } 1489 }
1488 1490
1489 void WindowTreeClient::OnConnect(ClientSpecificId client_id) { 1491 void WindowTreeClient::OnConnect(ClientSpecificId client_id) {
1492 LOG(WARNING) << "OnConnect";
1490 client_id_ = client_id; 1493 client_id_ = client_id;
1494 got_initial_displays_ = true;
1491 if (window_manager_delegate_) 1495 if (window_manager_delegate_)
1492 window_manager_delegate_->OnWmConnected(); 1496 window_manager_delegate_->OnWmConnected();
1493 } 1497 }
1494 1498
1495 void WindowTreeClient::WmNewDisplayAdded( 1499 void WindowTreeClient::WmNewDisplayAdded(
1496 const display::Display& display, 1500 const display::Display& display,
1497 ui::mojom::WindowDataPtr root_data, 1501 ui::mojom::WindowDataPtr root_data,
1498 bool parent_drawn, 1502 bool parent_drawn,
1499 const cc::FrameSinkId& frame_sink_id, 1503 const cc::FrameSinkId& frame_sink_id,
1500 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { 1504 const base::Optional<cc::LocalSurfaceId>& local_surface_id) {
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( 2035 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>(
2032 this, capture_synchronizer_.get(), window)); 2036 this, capture_synchronizer_.get(), window));
2033 } 2037 }
2034 2038
2035 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { 2039 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) {
2036 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( 2040 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>(
2037 this, focus_synchronizer_.get(), window)); 2041 this, focus_synchronizer_.get(), window));
2038 } 2042 }
2039 2043
2040 } // namespace aura 2044 } // namespace aura
OLDNEW
« no previous file with comments | « services/ui/ws/window_server.cc ('k') | ui/aura/window_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698