| 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/controls/menu/menu_host.h" | 5 #include "ui/views/controls/menu/menu_host.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "ui/events/gestures/gesture_recognizer.h" | 9 #include "ui/events/gestures/gesture_recognizer.h" |
| 10 #include "ui/gfx/path.h" | 10 #include "ui/gfx/path.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 bool rounded_border = menu_controller && menu_config.corner_radius > 0; | 45 bool rounded_border = menu_controller && menu_config.corner_radius > 0; |
| 46 bool bubble_border = submenu_->GetScrollViewContainer() && | 46 bool bubble_border = submenu_->GetScrollViewContainer() && |
| 47 submenu_->GetScrollViewContainer()->HasBubbleBorder(); | 47 submenu_->GetScrollViewContainer()->HasBubbleBorder(); |
| 48 params.shadow_type = bubble_border ? Widget::InitParams::SHADOW_TYPE_NONE | 48 params.shadow_type = bubble_border ? Widget::InitParams::SHADOW_TYPE_NONE |
| 49 : Widget::InitParams::SHADOW_TYPE_DROP; | 49 : Widget::InitParams::SHADOW_TYPE_DROP; |
| 50 params.opacity = (bubble_border || rounded_border) ? | 50 params.opacity = (bubble_border || rounded_border) ? |
| 51 Widget::InitParams::TRANSLUCENT_WINDOW : | 51 Widget::InitParams::TRANSLUCENT_WINDOW : |
| 52 Widget::InitParams::OPAQUE_WINDOW; | 52 Widget::InitParams::OPAQUE_WINDOW; |
| 53 params.parent = parent ? parent->GetNativeView() : NULL; | 53 params.parent = parent ? parent->GetNativeView() : NULL; |
| 54 params.bounds = bounds; | 54 params.bounds = bounds; |
| 55 #if defined(OS_WIN) |
| 56 // On Windows use the software compositor to ensure that we don't block |
| 57 // the UI thread blocking issue during command buffer creation. We can |
| 58 // revert this change once http://crbug.com/125248 is fixed. |
| 59 params.force_software_compositing = true; |
| 60 #endif |
| 55 Init(params); | 61 Init(params); |
| 56 | 62 |
| 57 SetContentsView(contents_view); | 63 SetContentsView(contents_view); |
| 58 ShowMenuHost(do_capture); | 64 ShowMenuHost(do_capture); |
| 59 } | 65 } |
| 60 | 66 |
| 61 bool MenuHost::IsMenuHostVisible() { | 67 bool MenuHost::IsMenuHostVisible() { |
| 62 return IsVisible(); | 68 return IsVisible(); |
| 63 } | 69 } |
| 64 | 70 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 165 } |
| 160 menu_controller->OnDragComplete(should_close); | 166 menu_controller->OnDragComplete(should_close); |
| 161 | 167 |
| 162 // We may have lost capture in the drag and drop, but are remaining open. | 168 // We may have lost capture in the drag and drop, but are remaining open. |
| 163 // Return capture so we get MouseCaptureLost events. | 169 // Return capture so we get MouseCaptureLost events. |
| 164 if (!should_close) | 170 if (!should_close) |
| 165 native_widget_private()->SetCapture(); | 171 native_widget_private()->SetCapture(); |
| 166 } | 172 } |
| 167 | 173 |
| 168 } // namespace views | 174 } // namespace views |
| OLD | NEW |