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

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

Issue 2565583002: Revert of Ensure compositor initialized before WindowTreeHost is Shown. (Closed)
Patch Set: 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 // Ensure that compositor has been properly initialized, see InitCompositor() 212 if (compositor())
213 // and InitHost(). 213 compositor()->SetVisible(true);
214 DCHECK(compositor());
215 DCHECK_EQ(compositor()->root_layer(), window()->layer());
216 compositor()->SetVisible(true);
217 ShowImpl(); 214 ShowImpl();
218 } 215 }
219 216
220 void WindowTreeHost::Hide() { 217 void WindowTreeHost::Hide() {
221 HideImpl(); 218 HideImpl();
222 if (compositor()) 219 if (compositor())
223 compositor()->SetVisible(false); 220 compositor()->SetVisible(false);
224 } 221 }
225 222
226 //////////////////////////////////////////////////////////////////////////////// 223 ////////////////////////////////////////////////////////////////////////////////
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 client::CursorClient* cursor_client = client::GetCursorClient(window()); 339 client::CursorClient* cursor_client = client::GetCursorClient(window());
343 if (cursor_client) { 340 if (cursor_client) {
344 const display::Display& display = 341 const display::Display& display =
345 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); 342 display::Screen::GetScreen()->GetDisplayNearestWindow(window());
346 cursor_client->SetDisplay(display); 343 cursor_client->SetDisplay(display);
347 } 344 }
348 dispatcher()->OnCursorMovedToRootLocation(root_location); 345 dispatcher()->OnCursorMovedToRootLocation(root_location);
349 } 346 }
350 347
351 } // namespace aura 348 } // 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