| 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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 View::ConvertPointToScreen(source->GetScrollViewContainer(), | 772 View::ConvertPointToScreen(source->GetScrollViewContainer(), |
| 773 &screen_location); | 773 &screen_location); |
| 774 if (ShowContextMenu(part.menu, screen_location, ui::MENU_SOURCE_TOUCH)) | 774 if (ShowContextMenu(part.menu, screen_location, ui::MENU_SOURCE_TOUCH)) |
| 775 event->StopPropagation(); | 775 event->StopPropagation(); |
| 776 } | 776 } |
| 777 } else if (event->type() == ui::ET_GESTURE_TAP) { | 777 } else if (event->type() == ui::ET_GESTURE_TAP) { |
| 778 if (!part.is_scroll() && part.menu && | 778 if (!part.is_scroll() && part.menu && |
| 779 !(part.menu->HasSubmenu())) { | 779 !(part.menu->HasSubmenu())) { |
| 780 if (part.menu->GetDelegate()->IsTriggerableEvent( | 780 if (part.menu->GetDelegate()->IsTriggerableEvent( |
| 781 part.menu, *event)) { | 781 part.menu, *event)) { |
| 782 item_selected_by_touch_ = true; |
| 782 Accept(part.menu, event->flags()); | 783 Accept(part.menu, event->flags()); |
| 783 item_selected_by_touch_ = true; | |
| 784 } | 784 } |
| 785 event->StopPropagation(); | 785 event->StopPropagation(); |
| 786 } else if (part.type == MenuPart::MENU_ITEM) { | 786 } else if (part.type == MenuPart::MENU_ITEM) { |
| 787 // User either tapped on empty space, or a menu that has children. | 787 // User either tapped on empty space, or a menu that has children. |
| 788 SetSelection(part.menu ? part.menu : state_.item, | 788 SetSelection(part.menu ? part.menu : state_.item, |
| 789 SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY); | 789 SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY); |
| 790 event->StopPropagation(); | 790 event->StopPropagation(); |
| 791 } | 791 } |
| 792 } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL && | 792 } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL && |
| 793 part.menu && | 793 part.menu && |
| (...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2646 return; | 2646 return; |
| 2647 } | 2647 } |
| 2648 if (hot_button_) | 2648 if (hot_button_) |
| 2649 hot_button_->SetHotTracked(false); | 2649 hot_button_->SetHotTracked(false); |
| 2650 hot_button_ = hot_button; | 2650 hot_button_ = hot_button; |
| 2651 if (hot_button) | 2651 if (hot_button) |
| 2652 hot_button->SetHotTracked(true); | 2652 hot_button->SetHotTracked(true); |
| 2653 } | 2653 } |
| 2654 | 2654 |
| 2655 } // namespace views | 2655 } // namespace views |
| OLD | NEW |