Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ui / aura / window.cc
index 4645659..df66b70 100644 (file)
@@ -361,8 +361,8 @@ void Window::Show() {
 }
 
 void Window::Hide() {
+  // RootWindow::OnVisibilityChanged will call ReleaseCapture.
   SetVisible(false);
-  ReleaseCapture();
 }
 
 bool Window::IsVisible() const {
@@ -433,6 +433,13 @@ void Window::SetLayoutManager(LayoutManager* layout_manager) {
     layout_manager_->OnWindowAddedToLayout(*it);
 }
 
+scoped_ptr<ui::EventTargeter>
+Window::SetEventTargeter(scoped_ptr<ui::EventTargeter> targeter) {
+  scoped_ptr<ui::EventTargeter> old_targeter = targeter_.Pass();
+  targeter_ = targeter.Pass();
+  return old_targeter.Pass();
+}
+
 void Window::SetBounds(const gfx::Rect& new_bounds) {
   if (parent_ && parent_->layout_manager())
     parent_->layout_manager()->SetChildBounds(this, new_bounds);
@@ -623,7 +630,7 @@ void Window::MoveCursorTo(const gfx::Point& point_in_window) {
   DCHECK(root_window);
   gfx::Point point_in_root(point_in_window);
   ConvertPointToTarget(this, root_window, &point_in_root);
-  root_window->GetDispatcher()->MoveCursorTo(point_in_root);
+  root_window->GetDispatcher()->host()->MoveCursorTo(point_in_root);
 }
 
 gfx::NativeCursor Window::GetCursor(const gfx::Point& point) const {
@@ -664,13 +671,7 @@ bool Window::ContainsPoint(const gfx::Point& local_point) const {
 }
 
 bool Window::HitTest(const gfx::Point& local_point) {
-  // Expand my bounds for hit testing (override is usually zero but it's
-  // probably cheaper to do the math every time than to branch).
-  gfx::Rect local_bounds(gfx::Point(), bounds().size());
-  local_bounds.Inset(aura::Env::GetInstance()->is_touch_down() ?
-      hit_test_bounds_override_outer_touch_ :
-      hit_test_bounds_override_outer_mouse_);
-
+  gfx::Rect local_bounds(bounds().size());
   if (!delegate_ || !delegate_->HasHitTestMask())
     return local_bounds.Contains(local_point);