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/base/accessibility/accessible_view_state.h" | 7 #include "ui/base/accessibility/accessible_view_state.h" |
8 #include "ui/gfx/animation/slide_animation.h" | 8 #include "ui/gfx/animation/slide_animation.h" |
9 #include "ui/gfx/color_utils.h" | 9 #include "ui/gfx/color_utils.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 color_ = GetNativeTheme()->GetSystemColor( | 335 color_ = GetNativeTheme()->GetSystemColor( |
336 ui::NativeTheme::kColorId_WindowBackground); | 336 ui::NativeTheme::kColorId_WindowBackground); |
337 } | 337 } |
338 set_background(Background::CreateSolidBackground(color())); | 338 set_background(Background::CreateSolidBackground(color())); |
339 BubbleFrameView* frame_view = GetBubbleFrameView(); | 339 BubbleFrameView* frame_view = GetBubbleFrameView(); |
340 if (frame_view) | 340 if (frame_view) |
341 frame_view->bubble_border()->set_background_color(color()); | 341 frame_view->bubble_border()->set_background_color(color()); |
342 } | 342 } |
343 | 343 |
344 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { | 344 void BubbleDelegateView::HandleVisibilityChanged(Widget* widget, bool visible) { |
345 if (widget == GetWidget() && visible && anchor_widget() && | 345 if (widget == GetWidget() && anchor_widget() && |
346 anchor_widget()->GetTopLevelWidget()) { | 346 anchor_widget()->GetTopLevelWidget()) { |
347 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); | 347 if (visible) |
| 348 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); |
| 349 else |
| 350 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); |
348 } | 351 } |
349 } | 352 } |
350 | 353 |
351 } // namespace views | 354 } // namespace views |
OLD | NEW |