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

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 11299119: Fix html select tag on 2nd display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove comment Created 8 years, 1 month 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 63d1fe94eee433f323faefc664fe0309475f7717..f9a9e61746a921455061fd582962880b2e2b1223 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -258,9 +258,11 @@ class WebContentsViewAura::WindowObserver
explicit WindowObserver(WebContentsViewAura* view)
: view_(view),
parent_(NULL) {
+ view_->window_->AddObserver(this);
}
virtual ~WindowObserver() {
+ view_->window_->RemoveObserver(this);
if (parent_)
parent_->RemoveObserver(this);
}
@@ -268,6 +270,8 @@ class WebContentsViewAura::WindowObserver
// Overridden from aura::WindowObserver:
virtual void OnWindowParentChanged(aura::Window* window,
aura::Window* parent) OVERRIDE {
+ if (window == parent_)
+ return;
if (parent_)
parent_->RemoveObserver(this);
parent_ = parent;
@@ -278,16 +282,17 @@ class WebContentsViewAura::WindowObserver
virtual void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) {
- // This is for the Ash case.
oshima 2012/11/20 23:21:03 This is necessary for non ash as well. WebContentV
SendScreenRects();
}
virtual void OnWindowAddedToRootWindow(aura::Window* window) OVERRIDE {
- window->GetRootWindow()->AddRootWindowObserver(this);
+ if (window != parent_)
+ window->GetRootWindow()->AddRootWindowObserver(this);
}
virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE {
- window->GetRootWindow()->RemoveRootWindowObserver(this);
+ if (window != parent_)
+ window->GetRootWindow()->RemoveRootWindowObserver(this);
}
// Overridden RootWindowObserver:
@@ -338,7 +343,7 @@ WebContentsViewAura::~WebContentsViewAura() {
if (!window_)
return;
- window_->RemoveObserver(window_observer_.get());
+ window_observer_.reset();
// Window needs a valid delegate during its destructor, so we explicitly
// delete it here.
window_.reset();
@@ -504,7 +509,6 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size) {
window_->SetName("WebContentsViewAura");
window_observer_.reset(new WindowObserver(this));
- window_->AddObserver(window_observer_.get());
// delegate_->GetDragDestDelegate() creates a new delegate on every call.
// Hence, we save a reference to it locally. Similar model is used on other
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698