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

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

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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/bubble/bubble_delegate_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/accessibility/ax_view_state.h" 7 #include "ui/accessibility/ax_view_state.h"
8 #include "ui/gfx/color_utils.h" 8 #include "ui/gfx/color_utils.h"
9 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
10 #include "ui/native_theme/native_theme.h" 10 #include "ui/native_theme/native_theme.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget, 174 void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget,
175 const gfx::Rect& new_bounds) { 175 const gfx::Rect& new_bounds) {
176 if (anchor_widget() == widget) 176 if (anchor_widget() == widget)
177 SizeToContents(); 177 SizeToContents();
178 } 178 }
179 179
180 View* BubbleDelegateView::GetAnchorView() const { 180 View* BubbleDelegateView::GetAnchorView() const {
181 return ViewStorage::GetInstance()->RetrieveView(anchor_view_storage_id_); 181 return ViewStorage::GetInstance()->RetrieveView(anchor_view_storage_id_);
182 } 182 }
183 183
184 gfx::Rect BubbleDelegateView::GetAnchorRect() { 184 gfx::Rect BubbleDelegateView::GetAnchorRect() const {
185 if (!GetAnchorView()) 185 if (!GetAnchorView())
186 return anchor_rect_; 186 return anchor_rect_;
187 187
188 anchor_rect_ = GetAnchorView()->GetBoundsInScreen(); 188 anchor_rect_ = GetAnchorView()->GetBoundsInScreen();
189 anchor_rect_.Inset(anchor_view_insets_); 189 anchor_rect_.Inset(anchor_view_insets_);
190 return anchor_rect_; 190 return anchor_rect_;
191 } 191 }
192 192
193 void BubbleDelegateView::OnBeforeBubbleWidgetInit(Widget::InitParams* params, 193 void BubbleDelegateView::OnBeforeBubbleWidgetInit(Widget::InitParams* params,
194 Widget* widget) const { 194 Widget* widget) const {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 if (widget == GetWidget() && anchor_widget() && 289 if (widget == GetWidget() && anchor_widget() &&
290 anchor_widget()->GetTopLevelWidget()) { 290 anchor_widget()->GetTopLevelWidget()) {
291 if (visible) 291 if (visible)
292 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); 292 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering();
293 else 293 else
294 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); 294 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering();
295 } 295 }
296 } 296 }
297 297
298 } // namespace views 298 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/bubble/bubble_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698