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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 11418262: Fix crash on win_aura buildbot because a RootWindow was getting multiple AddRootWindowObserver call… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: check RootWindow before using it Created 8 years 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 | « no previous file | 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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698