| 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_controller.h" | 5 #include "ui/views/controls/menu/menu_controller.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2392 base::WeakPtr<MenuController> this_ref = AsWeakPtr(); | 2392 base::WeakPtr<MenuController> this_ref = AsWeakPtr(); |
| 2393 if (state_.item) { | 2393 if (state_.item) { |
| 2394 state_.item->GetRootMenuItem()->GetSubmenu()->ReleaseCapture(); | 2394 state_.item->GetRootMenuItem()->GetSubmenu()->ReleaseCapture(); |
| 2395 // We're going to close and we own the event capture. We need to repost | 2395 // We're going to close and we own the event capture. We need to repost |
| 2396 // the event, otherwise the window the user clicked on won't get the | 2396 // the event, otherwise the window the user clicked on won't get the |
| 2397 // event. | 2397 // event. |
| 2398 RepostEventImpl(event, screen_loc, native_view, window); | 2398 RepostEventImpl(event, screen_loc, native_view, window); |
| 2399 } else { | 2399 } else { |
| 2400 // We some times get an event after closing all the menus. Ignore it. Make | 2400 // We some times get an event after closing all the menus. Ignore it. Make |
| 2401 // sure the menu is in fact not visible. If the menu is visible, then | 2401 // sure the menu is in fact not visible. If the menu is visible, then |
| 2402 // we're in a bad state where we think the menu isn't visibile but it is. | 2402 // we're in a bad state where we think the menu isn't visible but it is. |
| 2403 DCHECK(!source->GetWidget()->IsVisible()); | 2403 DCHECK(!source->GetWidget()->IsVisible()); |
| 2404 } | 2404 } |
| 2405 | 2405 |
| 2406 // Reposting the event may have deleted this, if so exit. | 2406 // Reposting the event may have deleted this, if so exit. |
| 2407 if (!this_ref) | 2407 if (!this_ref) |
| 2408 return; | 2408 return; |
| 2409 } | 2409 } |
| 2410 #endif | 2410 #endif |
| 2411 | 2411 |
| 2412 // Determine target to see if a complete or partial close of the menu should | 2412 // Determine target to see if a complete or partial close of the menu should |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2714 if (hot_button_) | 2714 if (hot_button_) |
| 2715 hot_button_->SetHotTracked(false); | 2715 hot_button_->SetHotTracked(false); |
| 2716 hot_button_ = hot_button; | 2716 hot_button_ = hot_button; |
| 2717 if (hot_button) { | 2717 if (hot_button) { |
| 2718 hot_button->SetHotTracked(true); | 2718 hot_button->SetHotTracked(true); |
| 2719 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); | 2719 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); |
| 2720 } | 2720 } |
| 2721 } | 2721 } |
| 2722 | 2722 |
| 2723 } // namespace views | 2723 } // namespace views |
| OLD | NEW |