OLD | NEW |
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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/browser/renderer_host/dip_util.h" | 9 #include "content/browser/renderer_host/dip_util.h" |
10 #include "content/browser/renderer_host/overscroll_controller.h" | 10 #include "content/browser/renderer_host/overscroll_controller.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 : public aura::WindowObserver, public aura::RootWindowObserver { | 257 : public aura::WindowObserver, public aura::RootWindowObserver { |
258 public: | 258 public: |
259 explicit WindowObserver(WebContentsViewAura* view) | 259 explicit WindowObserver(WebContentsViewAura* view) |
260 : view_(view), | 260 : view_(view), |
261 parent_(NULL) { | 261 parent_(NULL) { |
262 view_->window_->AddObserver(this); | 262 view_->window_->AddObserver(this); |
263 } | 263 } |
264 | 264 |
265 virtual ~WindowObserver() { | 265 virtual ~WindowObserver() { |
266 view_->window_->RemoveObserver(this); | 266 view_->window_->RemoveObserver(this); |
| 267 if (view_->window_->GetRootWindow()) |
| 268 view_->window_->GetRootWindow()->RemoveRootWindowObserver(this); |
267 if (parent_) | 269 if (parent_) |
268 parent_->RemoveObserver(this); | 270 parent_->RemoveObserver(this); |
269 } | 271 } |
270 | 272 |
271 // Overridden from aura::WindowObserver: | 273 // Overridden from aura::WindowObserver: |
272 virtual void OnWindowParentChanged(aura::Window* window, | 274 virtual void OnWindowParentChanged(aura::Window* window, |
273 aura::Window* parent) OVERRIDE { | 275 aura::Window* parent) OVERRIDE { |
274 if (window == parent_) | 276 if (window == parent_) |
275 return; | 277 return; |
276 if (parent_) | 278 if (parent_) |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 event.location(), | 996 event.location(), |
995 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 997 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
996 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 998 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
997 if (drag_dest_delegate_) | 999 if (drag_dest_delegate_) |
998 drag_dest_delegate_->OnDrop(); | 1000 drag_dest_delegate_->OnDrop(); |
999 current_drop_data_.reset(); | 1001 current_drop_data_.reset(); |
1000 return current_drag_op_; | 1002 return current_drag_op_; |
1001 } | 1003 } |
1002 | 1004 |
1003 } // namespace content | 1005 } // namespace content |
OLD | NEW |