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

Side by Side Diff: ui/aura/window_tree_host.cc

Issue 2552003002: Ensure compositor initialized before WindowTreeHost is Shown. (Closed)
Patch Set: Fixing WindowServerTest.EstablishConnectionViaFactory 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/aura/mus/window_tree_client_unittest.cc ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/window_tree_host.h" 5 #include "ui/aura/window_tree_host.h"
6 6
7 #include "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "ui/aura/client/capture_client.h" 9 #include "ui/aura/client/capture_client.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 input_method_ = input_method; 202 input_method_ = input_method;
203 owned_input_method_ = false; 203 owned_input_method_ = false;
204 } 204 }
205 205
206 ui::EventDispatchDetails WindowTreeHost::DispatchKeyEventPostIME( 206 ui::EventDispatchDetails WindowTreeHost::DispatchKeyEventPostIME(
207 ui::KeyEvent* event) { 207 ui::KeyEvent* event) {
208 return SendEventToProcessor(event); 208 return SendEventToProcessor(event);
209 } 209 }
210 210
211 void WindowTreeHost::Show() { 211 void WindowTreeHost::Show() {
212 if (compositor()) 212 // Ensure that compositor has been properly initialized, see InitCompositor()
213 compositor()->SetVisible(true); 213 // and InitHost().
214 DCHECK(compositor());
215 DCHECK_EQ(compositor()->root_layer(), window()->layer());
216 compositor()->SetVisible(true);
214 ShowImpl(); 217 ShowImpl();
215 } 218 }
216 219
217 void WindowTreeHost::Hide() { 220 void WindowTreeHost::Hide() {
218 HideImpl(); 221 HideImpl();
219 if (compositor()) 222 if (compositor())
220 compositor()->SetVisible(false); 223 compositor()->SetVisible(false);
221 } 224 }
222 225
223 //////////////////////////////////////////////////////////////////////////////// 226 ////////////////////////////////////////////////////////////////////////////////
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 client::CursorClient* cursor_client = client::GetCursorClient(window()); 342 client::CursorClient* cursor_client = client::GetCursorClient(window());
340 if (cursor_client) { 343 if (cursor_client) {
341 const display::Display& display = 344 const display::Display& display =
342 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); 345 display::Screen::GetScreen()->GetDisplayNearestWindow(window());
343 cursor_client->SetDisplay(display); 346 cursor_client->SetDisplay(display);
344 } 347 }
345 dispatcher()->OnCursorMovedToRootLocation(root_location); 348 dispatcher()->OnCursorMovedToRootLocation(root_location);
346 } 349 }
347 350
348 } // namespace aura 351 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/window_tree_client_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698