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

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: Add two more const for Windows. 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
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget, 173 void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget,
174 const gfx::Rect& new_bounds) { 174 const gfx::Rect& new_bounds) {
175 if (anchor_widget() == widget) 175 if (anchor_widget() == widget)
176 SizeToContents(); 176 SizeToContents();
177 } 177 }
178 178
179 View* BubbleDelegateView::GetAnchorView() const { 179 View* BubbleDelegateView::GetAnchorView() const {
180 return ViewStorage::GetInstance()->RetrieveView(anchor_view_storage_id_); 180 return ViewStorage::GetInstance()->RetrieveView(anchor_view_storage_id_);
181 } 181 }
182 182
183 gfx::Rect BubbleDelegateView::GetAnchorRect() { 183 gfx::Rect BubbleDelegateView::GetAnchorRect() const {
184 if (!GetAnchorView()) 184 if (!GetAnchorView())
185 return anchor_rect_; 185 return anchor_rect_;
186 186
187 anchor_rect_ = GetAnchorView()->GetBoundsInScreen(); 187 anchor_rect_ = GetAnchorView()->GetBoundsInScreen();
188 anchor_rect_.Inset(anchor_view_insets_); 188 anchor_rect_.Inset(anchor_view_insets_);
189 return anchor_rect_; 189 return anchor_rect_;
190 } 190 }
191 191
192 void BubbleDelegateView::OnBeforeBubbleWidgetInit(Widget::InitParams* params, 192 void BubbleDelegateView::OnBeforeBubbleWidgetInit(Widget::InitParams* params,
193 Widget* widget) const { 193 Widget* widget) const {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 if (widget == GetWidget() && anchor_widget() && 288 if (widget == GetWidget() && anchor_widget() &&
289 anchor_widget()->GetTopLevelWidget()) { 289 anchor_widget()->GetTopLevelWidget()) {
290 if (visible) 290 if (visible)
291 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); 291 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering();
292 else 292 else
293 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); 293 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering();
294 } 294 }
295 } 295 }
296 296
297 } // namespace views 297 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698