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 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 } | 1733 } |
1734 | 1734 |
1735 // If no mnemonics found, look at first character of titles. | 1735 // If no mnemonics found, look at first character of titles. |
1736 details = FindChildForMnemonic(item, key, &TitleMatchesMnemonic); | 1736 details = FindChildForMnemonic(item, key, &TitleMatchesMnemonic); |
1737 if (details.first_match != -1) | 1737 if (details.first_match != -1) |
1738 return AcceptOrSelect(item, details); | 1738 return AcceptOrSelect(item, details); |
1739 | 1739 |
1740 return false; | 1740 return false; |
1741 } | 1741 } |
1742 | 1742 |
1743 #if defined(OS_WIN) | 1743 #if defined(OS_WIN) && !defined(USE_AURA) |
1744 void MenuController::RepostEvent(SubmenuView* source, | 1744 void MenuController::RepostEvent(SubmenuView* source, |
1745 const MouseEvent& event) { | 1745 const MouseEvent& event) { |
1746 if (!state_.item) { | 1746 if (!state_.item) { |
1747 // We some times get an event after closing all the menus. Ignore it. | 1747 // We some times get an event after closing all the menus. Ignore it. |
1748 // Make sure the menu is in fact not visible. If the menu is visible, then | 1748 // Make sure the menu is in fact not visible. If the menu is visible, then |
1749 // we're in a bad state where we think the menu isn't visibile but it is. | 1749 // we're in a bad state where we think the menu isn't visibile but it is. |
1750 DCHECK(!source->GetWidget()->IsVisible()); | 1750 DCHECK(!source->GetWidget()->IsVisible()); |
1751 return; | 1751 return; |
1752 } | 1752 } |
1753 | 1753 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 return; | 1907 return; |
1908 | 1908 |
1909 // Reset the active_mouse_view_ before sending mouse capture lost. That way if | 1909 // Reset the active_mouse_view_ before sending mouse capture lost. That way if |
1910 // it calls back to us, we aren't in a weird state. | 1910 // it calls back to us, we aren't in a weird state. |
1911 View* active_view = active_mouse_view_; | 1911 View* active_view = active_mouse_view_; |
1912 active_mouse_view_ = NULL; | 1912 active_mouse_view_ = NULL; |
1913 active_view->OnMouseCaptureLost(); | 1913 active_view->OnMouseCaptureLost(); |
1914 } | 1914 } |
1915 | 1915 |
1916 } // namespace views | 1916 } // namespace views |
OLD | NEW |