| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 gfx::Rect BubbleDelegateView::GetBubbleBounds() { | 272 gfx::Rect BubbleDelegateView::GetBubbleBounds() { |
| 273 // The argument rect has its origin at the bubble's arrow anchor point; | 273 // The argument rect has its origin at the bubble's arrow anchor point; |
| 274 // its size is the preferred size of the bubble's client view (this view). | 274 // its size is the preferred size of the bubble's client view (this view). |
| 275 return GetBubbleFrameView()->GetUpdatedWindowBounds(GetAnchorRect(), | 275 return GetBubbleFrameView()->GetUpdatedWindowBounds(GetAnchorRect(), |
| 276 GetPreferredSize(), adjust_if_offscreen_); | 276 GetPreferredSize(), adjust_if_offscreen_); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void BubbleDelegateView::UpdateColorsFromTheme(const ui::NativeTheme* theme) { | 279 void BubbleDelegateView::UpdateColorsFromTheme(const ui::NativeTheme* theme) { |
| 280 if (!color_explicitly_set_) | 280 if (!color_explicitly_set_) |
| 281 color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_WindowBackground); | 281 color_ = theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground); |
| 282 set_background(Background::CreateSolidBackground(color())); | 282 set_background(Background::CreateSolidBackground(color())); |
| 283 BubbleFrameView* frame_view = GetBubbleFrameView(); | 283 BubbleFrameView* frame_view = GetBubbleFrameView(); |
| 284 if (frame_view) | 284 if (frame_view) |
| 285 frame_view->bubble_border()->set_background_color(color()); | 285 frame_view->bubble_border()->set_background_color(color()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { | 288 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { |
| 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 |