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/base/resource/resource_bundle.h" | 8 #include "ui/base/resource/resource_bundle.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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 SetAnchorView(NULL); | 89 SetAnchorView(NULL); |
90 } | 90 } |
91 | 91 |
92 // static | 92 // static |
93 Widget* BubbleDelegateView::CreateBubble(BubbleDelegateView* bubble_delegate) { | 93 Widget* BubbleDelegateView::CreateBubble(BubbleDelegateView* bubble_delegate) { |
94 bubble_delegate->Init(); | 94 bubble_delegate->Init(); |
95 // Get the latest anchor widget from the anchor view at bubble creation time. | 95 // Get the latest anchor widget from the anchor view at bubble creation time. |
96 bubble_delegate->SetAnchorView(bubble_delegate->GetAnchorView()); | 96 bubble_delegate->SetAnchorView(bubble_delegate->GetAnchorView()); |
97 Widget* bubble_widget = CreateBubbleWidget(bubble_delegate); | 97 Widget* bubble_widget = CreateBubbleWidget(bubble_delegate); |
98 | 98 |
99 #if defined(OS_WIN) | 99 #if defined(OS_MACOSX) |
| 100 bubble_delegate->set_adjust_if_offscreen(true); |
| 101 #elif defined(OS_WIN) |
100 // If glass is enabled, the bubble is allowed to extend outside the bounds of | 102 // If glass is enabled, the bubble is allowed to extend outside the bounds of |
101 // the parent frame and let DWM handle compositing. If not, then we don't | 103 // the parent frame and let DWM handle compositing. If not, then we don't |
102 // want to allow the bubble to extend the frame because it will be clipped. | 104 // want to allow the bubble to extend the frame because it will be clipped. |
103 bubble_delegate->set_adjust_if_offscreen(ui::win::IsAeroGlassEnabled()); | 105 bubble_delegate->set_adjust_if_offscreen(ui::win::IsAeroGlassEnabled()); |
104 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) | 106 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) |
105 // Linux clips bubble windows that extend outside their parent window bounds. | 107 // Linux clips bubble windows that extend outside their parent window bounds. |
106 bubble_delegate->set_adjust_if_offscreen(false); | 108 bubble_delegate->set_adjust_if_offscreen(false); |
107 #endif | 109 #endif |
108 | 110 |
109 bubble_delegate->SizeToContents(); | 111 bubble_delegate->SizeToContents(); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 if (widget == GetWidget() && anchor_widget() && | 296 if (widget == GetWidget() && anchor_widget() && |
295 anchor_widget()->GetTopLevelWidget()) { | 297 anchor_widget()->GetTopLevelWidget()) { |
296 if (visible) | 298 if (visible) |
297 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); | 299 anchor_widget()->GetTopLevelWidget()->DisableInactiveRendering(); |
298 else | 300 else |
299 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); | 301 anchor_widget()->GetTopLevelWidget()->EnableInactiveRendering(); |
300 } | 302 } |
301 } | 303 } |
302 | 304 |
303 } // namespace views | 305 } // namespace views |
OLD | NEW |