| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/menu/menu_controller.h" | 5 #include "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/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 active_instance_ = NULL; | 1059 active_instance_ = NULL; |
| 1060 StopShowTimer(); | 1060 StopShowTimer(); |
| 1061 StopCancelAllTimer(); | 1061 StopCancelAllTimer(); |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 bool MenuController::SendAcceleratorToHotTrackedView() { | 1064 bool MenuController::SendAcceleratorToHotTrackedView() { |
| 1065 View* hot_view = GetFirstHotTrackedView(pending_state_.item); | 1065 View* hot_view = GetFirstHotTrackedView(pending_state_.item); |
| 1066 if (!hot_view) | 1066 if (!hot_view) |
| 1067 return false; | 1067 return false; |
| 1068 | 1068 |
| 1069 Accelerator accelerator(ui::VKEY_RETURN, false, false, false); | 1069 ui::Accelerator accelerator(ui::VKEY_RETURN, false, false, false); |
| 1070 hot_view->AcceleratorPressed(accelerator); | 1070 hot_view->AcceleratorPressed(accelerator); |
| 1071 hot_view->SetHotTracked(true); | 1071 hot_view->SetHotTracked(true); |
| 1072 return true; | 1072 return true; |
| 1073 } | 1073 } |
| 1074 | 1074 |
| 1075 void MenuController::UpdateInitialLocation( | 1075 void MenuController::UpdateInitialLocation( |
| 1076 const gfx::Rect& bounds, | 1076 const gfx::Rect& bounds, |
| 1077 MenuItemView::AnchorPosition position) { | 1077 MenuItemView::AnchorPosition position) { |
| 1078 pending_state_.initial_bounds = bounds; | 1078 pending_state_.initial_bounds = bounds; |
| 1079 if (bounds.height() > 1) { | 1079 if (bounds.height() > 1) { |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1955 return; | 1955 return; |
| 1956 | 1956 |
| 1957 // Reset the active_mouse_view_ before sending mouse capture lost. That way if | 1957 // Reset the active_mouse_view_ before sending mouse capture lost. That way if |
| 1958 // it calls back to us, we aren't in a weird state. | 1958 // it calls back to us, we aren't in a weird state. |
| 1959 View* active_view = active_mouse_view_; | 1959 View* active_view = active_mouse_view_; |
| 1960 active_mouse_view_ = NULL; | 1960 active_mouse_view_ = NULL; |
| 1961 active_view->OnMouseCaptureLost(); | 1961 active_view->OnMouseCaptureLost(); |
| 1962 } | 1962 } |
| 1963 | 1963 |
| 1964 } // namespace views | 1964 } // namespace views |
| OLD | NEW |