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

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

Issue 11273098: Relanding the EventTarget fixes for Aura (Ash) as the previous attempt was reverted due to interact… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 // If the layer is not animating, then we need to update the host size 445 // If the layer is not animating, then we need to update the host size
446 // immediately. 446 // immediately.
447 if (!layer()->GetAnimator()->is_animating()) 447 if (!layer()->GetAnimator()->is_animating())
448 OnHostResized(host_->GetBounds().size()); 448 OnHostResized(host_->GetBounds().size());
449 } 449 }
450 450
451 //////////////////////////////////////////////////////////////////////////////// 451 ////////////////////////////////////////////////////////////////////////////////
452 // RootWindow, ui::EventTarget implementation: 452 // RootWindow, ui::EventTarget implementation:
453 453
454 ui::EventTarget* RootWindow::GetParentTarget() { 454 ui::EventTarget* RootWindow::GetParentTarget() {
455 return Env::GetInstance(); 455 CHECK(client::GetEventClient(this));
456 return client::GetEventClient(this) ?
457 client::GetEventClient(this)->GetToplevelEventTarget() :
458 Env::GetInstance();
456 } 459 }
457 460
458 //////////////////////////////////////////////////////////////////////////////// 461 ////////////////////////////////////////////////////////////////////////////////
459 // RootWindow, ui::CompositorDelegate implementation: 462 // RootWindow, ui::CompositorDelegate implementation:
460 463
461 void RootWindow::ScheduleDraw() { 464 void RootWindow::ScheduleDraw() {
462 if (!defer_draw_scheduling_) { 465 if (!defer_draw_scheduling_) {
463 defer_draw_scheduling_ = true; 466 defer_draw_scheduling_ = true;
464 MessageLoop::current()->PostTask( 467 MessageLoop::current()->PostTask(
465 FROM_HERE, 468 FROM_HERE,
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 ui::MouseEvent event(ui::ET_MOUSE_MOVED, 1030 ui::MouseEvent event(ui::ET_MOUSE_MOVED,
1028 orig_mouse_location, 1031 orig_mouse_location,
1029 orig_mouse_location, 1032 orig_mouse_location,
1030 ui::EF_IS_SYNTHESIZED); 1033 ui::EF_IS_SYNTHESIZED);
1031 event.set_system_location(Env::GetInstance()->last_mouse_location()); 1034 event.set_system_location(Env::GetInstance()->last_mouse_location());
1032 OnHostMouseEvent(&event); 1035 OnHostMouseEvent(&event);
1033 #endif 1036 #endif
1034 } 1037 }
1035 1038
1036 } // namespace aura 1039 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698