OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |