| 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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2674 return; | 2674 return; |
| 2675 } | 2675 } |
| 2676 if (hot_button_) | 2676 if (hot_button_) |
| 2677 hot_button_->SetHotTracked(false); | 2677 hot_button_->SetHotTracked(false); |
| 2678 hot_button_ = hot_button; | 2678 hot_button_ = hot_button; |
| 2679 if (hot_button) | 2679 if (hot_button) |
| 2680 hot_button->SetHotTracked(true); | 2680 hot_button->SetHotTracked(true); |
| 2681 } | 2681 } |
| 2682 | 2682 |
| 2683 } // namespace views | 2683 } // namespace views |
| OLD | NEW |