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

Unified Diff: ui/aura/window_event_dispatcher.cc

Issue 184903003: Window ownership -> WindowTreeHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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/window_event_dispatcher.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_event_dispatcher.cc
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
index a07183081c3dc3eadcdf5ef7967bf054b607fbc0..98d268e9387f4da62cd8a9ba9e0b1bc526f651a3 100644
--- a/ui/aura/window_event_dispatcher.cc
+++ b/ui/aura/window_event_dispatcher.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -24,7 +24,6 @@
#include "ui/aura/window_tracker.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/hit_test.h"
-#include "ui/base/view_prop.h"
#include "ui/compositor/dip_util.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animator.h"
@@ -41,9 +40,6 @@ namespace aura {
namespace {
-const char kRootWindowForAcceleratedWidget[] =
- "__AURA_ROOT_WINDOW_ACCELERATED_WIDGET__";
-
// Returns true if |target| has a non-client (frame) component at |location|,
// in window coordinates.
bool IsNonClientLocation(Window* target, const gfx::Point& location) {
@@ -86,8 +82,7 @@ bool IsEventCandidateForHold(const ui::Event& event) {
// WindowEventDispatcher, public:
WindowEventDispatcher::WindowEventDispatcher(WindowTreeHost* host)
- : window_(new Window(NULL)),
- host_(host),
+ : host_(host),
touch_ids_down_(0),
mouse_pressed_handler_(NULL),
mouse_moved_handler_(NULL),
@@ -98,40 +93,12 @@ WindowEventDispatcher::WindowEventDispatcher(WindowTreeHost* host)
dispatching_held_event_(false),
repost_event_factory_(this),
held_event_factory_(this) {
- window()->Init(WINDOW_LAYER_NOT_DRAWN);
- window()->set_dispatcher(this);
- window()->SetName("RootWindow");
- window()->SetEventTargeter(
- scoped_ptr<ui::EventTargeter>(new WindowTargeter()));
-
- prop_.reset(new ui::ViewProp(host_->GetAcceleratedWidget(),
- kRootWindowForAcceleratedWidget,
- this));
ui::GestureRecognizer::Get()->AddGestureEventHelper(this);
}
WindowEventDispatcher::~WindowEventDispatcher() {
TRACE_EVENT0("shutdown", "WindowEventDispatcher::Destructor");
-
ui::GestureRecognizer::Get()->RemoveGestureEventHelper(this);
-
- // An observer may have been added by an animation on the
- // WindowEventDispatcher.
- window()->layer()->GetAnimator()->RemoveObserver(this);
-
- // Destroy child windows while we're still valid. This is also done by
- // ~Window, but by that time any calls to virtual methods overriden here (such
- // as GetRootWindow()) result in Window's implementation. By destroying here
- // we ensure GetRootWindow() still returns this.
- window()->RemoveOrDestroyChildren();
- window()->set_dispatcher(NULL);
-}
-
-// static
-WindowEventDispatcher* WindowEventDispatcher::GetForAcceleratedWidget(
- gfx::AcceleratedWidget widget) {
- return reinterpret_cast<WindowEventDispatcher*>(
- ui::ViewProp::GetValue(widget, kRootWindowForAcceleratedWidget));
}
void WindowEventDispatcher::PrepareForShutdown() {
« no previous file with comments | « ui/aura/window_event_dispatcher.h ('k') | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698