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

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

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 if ((event->flags() & ui::EF_RIGHT_MOUSE_BUTTON) && 1147 if ((event->flags() & ui::EF_RIGHT_MOUSE_BUTTON) &&
1148 (event->flags() & ui::EF_FROM_TOUCH)) 1148 (event->flags() & ui::EF_FROM_TOUCH))
1149 return; 1149 return;
1150 1150
1151 if (part.type == MenuPart::NONE || 1151 if (part.type == MenuPart::NONE ||
1152 (part.type == MenuPart::MENU_ITEM && part.menu && 1152 (part.type == MenuPart::MENU_ITEM && part.menu &&
1153 part.menu->GetRootMenuItem() != state_.item->GetRootMenuItem())) { 1153 part.menu->GetRootMenuItem() != state_.item->GetRootMenuItem())) {
1154 // Remember the time stamp of the current (press down) event. The owner can 1154 // Remember the time stamp of the current (press down) event. The owner can
1155 // then use this to figure out if this menu was finished with the same click 1155 // then use this to figure out if this menu was finished with the same click
1156 // which is sent to it thereafter. 1156 // which is sent to it thereafter.
1157 closing_event_time_ = event->time_stamp(); 1157 closing_event_time_ = event->time_stamp() - base::TimeTicks();
1158 // Event wasn't pressed over any menu, or the active menu, cancel. 1158 // Event wasn't pressed over any menu, or the active menu, cancel.
1159 RepostEventAndCancel(source, event); 1159 RepostEventAndCancel(source, event);
1160 // Do not repost events for Linux Aura because this behavior is more 1160 // Do not repost events for Linux Aura because this behavior is more
1161 // consistent with the behavior of other Linux apps. 1161 // consistent with the behavior of other Linux apps.
1162 return; 1162 return;
1163 } 1163 }
1164 1164
1165 // On a press we immediately commit the selection, that way a submenu 1165 // On a press we immediately commit the selection, that way a submenu
1166 // pops up immediately rather than after a delay. 1166 // pops up immediately rather than after a delay.
1167 int selection_types = SELECTION_UPDATE_IMMEDIATELY; 1167 int selection_types = SELECTION_UPDATE_IMMEDIATELY;
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2678 if (hot_button_) 2678 if (hot_button_)
2679 hot_button_->SetHotTracked(false); 2679 hot_button_->SetHotTracked(false);
2680 hot_button_ = hot_button; 2680 hot_button_ = hot_button;
2681 if (hot_button) { 2681 if (hot_button) {
2682 hot_button->SetHotTracked(true); 2682 hot_button->SetHotTracked(true);
2683 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); 2683 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true);
2684 } 2684 }
2685 } 2685 }
2686 2686
2687 } // namespace views 2687 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/menu/menu_runner_cocoa_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698