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

Unified Diff: ui/aura/root_window.cc

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/root_window.h ('k') | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 6aa65fe4400fc0ad30485841a5e9f2864e8aef0d..40c9f9cdffe063b8a056804596a7bd2866176d68 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -149,6 +149,7 @@ RootWindow::RootWindow(const CreateParams& params)
event_factory_(this),
held_event_factory_(this),
repostable_event_factory_(this) {
+ set_dispatcher(this);
SetName("RootWindow");
compositor_.reset(new ui::Compositor(host_->GetAcceleratedWidget()));
@@ -181,6 +182,8 @@ RootWindow::~RootWindow() {
// Destroying/removing child windows may try to access |host_| (eg.
// GetAcceleratedWidget())
host_.reset(NULL);
+
+ set_dispatcher(NULL);
}
// static
@@ -520,11 +523,11 @@ gfx::Transform RootWindow::GetRootTransform() const {
////////////////////////////////////////////////////////////////////////////////
// RootWindow, Window overrides:
-RootWindow* RootWindow::GetRootWindow() {
+Window* RootWindow::GetRootWindow() {
return this;
}
-const RootWindow* RootWindow::GetRootWindow() const {
+const Window* RootWindow::GetRootWindow() const {
return this;
}
@@ -613,7 +616,7 @@ void RootWindow::OnWindowAddedToRootWindow(Window* attached) {
}
void RootWindow::OnWindowRemovedFromRootWindow(Window* detached,
- RootWindow* new_root) {
+ Window* new_root) {
DCHECK(aura::client::GetCaptureWindow(this) != this);
DispatchMouseExitToHidingWindow(detached);
@@ -937,15 +940,15 @@ void RootWindow::DispatchMouseEventRepost(ui::MouseEvent* event) {
if (event->type() != ui::ET_MOUSE_PRESSED)
return;
Window* target = client::GetCaptureWindow(this);
- RootWindow* root = this;
+ WindowEventDispatcher* dispatcher = this;
if (!target) {
target = GetEventHandlerForPoint(event->location());
} else {
- root = target->GetRootWindow();
- CHECK(root); // Capture window better be in valid root.
+ dispatcher = target->GetDispatcher();
+ CHECK(dispatcher); // Capture window better be in valid root.
}
- root->mouse_pressed_handler_ = NULL;
- root->DispatchMouseEventToTarget(event, target);
+ dispatcher->mouse_pressed_handler_ = NULL;
+ dispatcher->DispatchMouseEventToTarget(event, target);
}
bool RootWindow::DispatchMouseEventToTarget(ui::MouseEvent* event,
« no previous file with comments | « ui/aura/root_window.h ('k') | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698