Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: ui/views/controls/menu/menu_controller.cc

Issue 1824993003: Fix MenuController Gesture Crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698