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

Side by Side Diff: ui/views/bubble/bubble_delegate.cc

Issue 10204014: views: Make sure the bubble-delegate removes itself from the anchor-widget's observer list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months 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 | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | 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 "ui/views/bubble/bubble_delegate.h" 5 #include "ui/views/bubble/bubble_delegate.h"
6 6
7 #include "ui/base/animation/slide_animation.h" 7 #include "ui/base/animation/slide_animation.h"
8 #include "ui/gfx/color_utils.h" 8 #include "ui/gfx/color_utils.h"
9 #include "ui/views/bubble/bubble_frame_view.h" 9 #include "ui/views/bubble/bubble_frame_view.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 View* BubbleDelegateView::GetInitiallyFocusedView() { 162 View* BubbleDelegateView::GetInitiallyFocusedView() {
163 return this; 163 return this;
164 } 164 }
165 165
166 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() { 166 BubbleDelegateView* BubbleDelegateView::AsBubbleDelegate() {
167 return this; 167 return this;
168 } 168 }
169 169
170 void BubbleDelegateView::WindowClosing() {
171 if (anchor_widget_) {
172 anchor_widget_->RemoveObserver(this);
173 anchor_widget_ = NULL;
174 anchor_view_ = NULL;
175 }
176 }
177
170 View* BubbleDelegateView::GetContentsView() { 178 View* BubbleDelegateView::GetContentsView() {
171 return this; 179 return this;
172 } 180 }
173 181
174 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView( 182 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView(
175 Widget* widget) { 183 Widget* widget) {
176 return new BubbleFrameView(arrow_location(), color(), margin()); 184 return new BubbleFrameView(arrow_location(), color(), margin());
177 } 185 }
178 186
179 void BubbleDelegateView::OnWidgetClosing(Widget* widget) { 187 void BubbleDelegateView::OnWidgetClosing(Widget* widget) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 333
326 #if defined(OS_WIN) && !defined(USE_AURA) 334 #if defined(OS_WIN) && !defined(USE_AURA)
327 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { 335 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const {
328 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); 336 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView());
329 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); 337 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin());
330 return client_bounds; 338 return client_bounds;
331 } 339 }
332 #endif 340 #endif
333 341
334 } // namespace views 342 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698