diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-09 20:55:54 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-09 20:55:54 +0000 |
commit | 5c2b98bd412b23db58345799a625b406b858ad4f (patch) | |
tree | 0e5dc8d2e4368d8d90e8d0367c5350794b610a36 /chrome/views/view.cc | |
parent | bc2f935b5525528f5b2c90c8de3a94be7d56b369 (diff) | |
download | chromium_src-5c2b98bd412b23db58345799a625b406b858ad4f.zip chromium_src-5c2b98bd412b23db58345799a625b406b858ad4f.tar.gz chromium_src-5c2b98bd412b23db58345799a625b406b858ad4f.tar.bz2 |
Fixes crash in ResizeCorner. ResizeCorner was caching the BrowserView
that created it, but if a tab contained a download shelf and was
dragged to a new window the ResizeCorner would be referencing the
wrong BrowserView. I've changed the code to look up the ancestor
BrowserView as necessary.
BUG=8477
TEST=see bug
Review URL: http://codereview.chromium.org/41010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/view.cc')
-rw-r--r-- | chrome/views/view.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/views/view.cc b/chrome/views/view.cc index e0fc3573..00c3e4b 100644 --- a/chrome/views/view.cc +++ b/chrome/views/view.cc @@ -1490,6 +1490,14 @@ std::string View::GetClassName() const { return kViewClassName; } +View* View::GetAncestorWithClassName(const std::string& name) { + for (View* view = this; view; view = view->GetParent()) { + if (view->GetClassName() == name) + return view; + } + return NULL; +} + gfx::Rect View::GetVisibleBounds() { if (!IsVisibleInRootView()) return gfx::Rect(); |