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

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

Issue 11314013: Register a separate default ui::EventTarget for Aura (Ash) to ensure that it does not interfere wit… (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
« no previous file with comments | « ui/aura/root_window.h ('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) 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 focus_manager_(NULL), 138 focus_manager_(NULL),
139 ALLOW_THIS_IN_INITIALIZER_LIST( 139 ALLOW_THIS_IN_INITIALIZER_LIST(
140 gesture_recognizer_(ui::GestureRecognizer::Create(this))), 140 gesture_recognizer_(ui::GestureRecognizer::Create(this))),
141 synthesize_mouse_move_(false), 141 synthesize_mouse_move_(false),
142 waiting_on_compositing_end_(false), 142 waiting_on_compositing_end_(false),
143 draw_on_compositing_end_(false), 143 draw_on_compositing_end_(false),
144 defer_draw_scheduling_(false), 144 defer_draw_scheduling_(false),
145 mouse_move_hold_count_(0), 145 mouse_move_hold_count_(0),
146 ALLOW_THIS_IN_INITIALIZER_LIST(held_mouse_event_factory_(this)), 146 ALLOW_THIS_IN_INITIALIZER_LIST(held_mouse_event_factory_(this)),
147 compositor_lock_(NULL), 147 compositor_lock_(NULL),
148 draw_on_compositor_unlock_(false) { 148 draw_on_compositor_unlock_(false),
149 parent_event_target_(NULL) {
149 SetName("RootWindow"); 150 SetName("RootWindow");
150 151
151 compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget())); 152 compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget()));
152 DCHECK(compositor_.get()); 153 DCHECK(compositor_.get());
153 compositor_->AddObserver(this); 154 compositor_->AddObserver(this);
154 155
155 prop_.reset(new ui::ViewProp(host_->GetAcceleratedWidget(), 156 prop_.reset(new ui::ViewProp(host_->GetAcceleratedWidget(),
156 kRootWindowForAcceleratedWidget, 157 kRootWindowForAcceleratedWidget,
157 this)); 158 this));
158 } 159 }
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 // If the layer is not animating, then we need to update the host size 479 // If the layer is not animating, then we need to update the host size
479 // immediately. 480 // immediately.
480 if (!layer()->GetAnimator()->is_animating()) 481 if (!layer()->GetAnimator()->is_animating())
481 OnHostResized(host_->GetBounds().size()); 482 OnHostResized(host_->GetBounds().size());
482 } 483 }
483 484
484 //////////////////////////////////////////////////////////////////////////////// 485 ////////////////////////////////////////////////////////////////////////////////
485 // RootWindow, ui::EventTarget implementation: 486 // RootWindow, ui::EventTarget implementation:
486 487
487 ui::EventTarget* RootWindow::GetParentTarget() { 488 ui::EventTarget* RootWindow::GetParentTarget() {
489 if (parent_event_target_)
Ben Goodger (Google) 2012/10/26 21:51:57 instead of doing this can we add a method to ui/au
ananta 2012/10/26 22:28:41 Done.
490 return parent_event_target_;
488 return Env::GetInstance(); 491 return Env::GetInstance();
489 } 492 }
490 493
491 //////////////////////////////////////////////////////////////////////////////// 494 ////////////////////////////////////////////////////////////////////////////////
492 // RootWindow, ui::CompositorDelegate implementation: 495 // RootWindow, ui::CompositorDelegate implementation:
493 496
494 void RootWindow::ScheduleDraw() { 497 void RootWindow::ScheduleDraw() {
495 if (compositor_lock_) { 498 if (compositor_lock_) {
496 draw_on_compositor_unlock_ = true; 499 draw_on_compositor_unlock_ = true;
497 } else if (!defer_draw_scheduling_) { 500 } else if (!defer_draw_scheduling_) {
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 void RootWindow::UnlockCompositor() { 1074 void RootWindow::UnlockCompositor() {
1072 DCHECK(compositor_lock_); 1075 DCHECK(compositor_lock_);
1073 compositor_lock_ = NULL; 1076 compositor_lock_ = NULL;
1074 if (draw_on_compositor_unlock_) { 1077 if (draw_on_compositor_unlock_) {
1075 draw_on_compositor_unlock_ = false; 1078 draw_on_compositor_unlock_ = false;
1076 ScheduleDraw(); 1079 ScheduleDraw();
1077 } 1080 }
1078 } 1081 }
1079 1082
1080 } // namespace aura 1083 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/root_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698