| 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/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 | 805 |
| 806 if (selection_types & SELECTION_UPDATE_IMMEDIATELY) | 806 if (selection_types & SELECTION_UPDATE_IMMEDIATELY) |
| 807 CommitPendingSelection(); | 807 CommitPendingSelection(); |
| 808 else if (pending_item_changed) | 808 else if (pending_item_changed) |
| 809 StartShowTimer(); | 809 StartShowTimer(); |
| 810 | 810 |
| 811 // Notify an accessibility focus event on all menu items except for the root. | 811 // Notify an accessibility focus event on all menu items except for the root. |
| 812 if (menu_item && | 812 if (menu_item && |
| 813 (MenuDepth(menu_item) != 1 || | 813 (MenuDepth(menu_item) != 1 || |
| 814 menu_item->GetType() != MenuItemView::SUBMENU)) { | 814 menu_item->GetType() != MenuItemView::SUBMENU)) { |
| 815 menu_item->GetWidget()->NotifyAccessibilityEvent( | 815 menu_item->NotifyAccessibilityEvent( |
| 816 menu_item, ui::AccessibilityTypes::EVENT_FOCUS, true); | 816 ui::AccessibilityTypes::EVENT_FOCUS, true); |
| 817 } | 817 } |
| 818 } | 818 } |
| 819 | 819 |
| 820 void MenuController::SetSelectionOnPointerDown(SubmenuView* source, | 820 void MenuController::SetSelectionOnPointerDown(SubmenuView* source, |
| 821 const ui::LocatedEvent& event) { | 821 const ui::LocatedEvent& event) { |
| 822 if (!blocking_run_) | 822 if (!blocking_run_) |
| 823 return; | 823 return; |
| 824 | 824 |
| 825 DCHECK(!active_mouse_view_); | 825 DCHECK(!active_mouse_view_); |
| 826 | 826 |
| (...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2275 (!pending_state_.item->HasSubmenu() || | 2275 (!pending_state_.item->HasSubmenu() || |
| 2276 !pending_state_.item->GetSubmenu()->IsShowing())) { | 2276 !pending_state_.item->GetSubmenu()->IsShowing())) { |
| 2277 // On exit if the user hasn't selected an item with a submenu, move the | 2277 // On exit if the user hasn't selected an item with a submenu, move the |
| 2278 // selection back to the parent menu item. | 2278 // selection back to the parent menu item. |
| 2279 SetSelection(pending_state_.item->GetParentMenuItem(), | 2279 SetSelection(pending_state_.item->GetParentMenuItem(), |
| 2280 SELECTION_OPEN_SUBMENU); | 2280 SELECTION_OPEN_SUBMENU); |
| 2281 } | 2281 } |
| 2282 } | 2282 } |
| 2283 | 2283 |
| 2284 } // namespace views | 2284 } // namespace views |
| OLD | NEW |