Chromium Code Reviews| 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 "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/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 882 | 882 |
| 883 #elif defined(USE_AURA) | 883 #elif defined(USE_AURA) |
| 884 base::MessagePumpDispatcher::DispatchStatus | 884 base::MessagePumpDispatcher::DispatchStatus |
| 885 MenuController::Dispatch(XEvent* xev) { | 885 MenuController::Dispatch(XEvent* xev) { |
| 886 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) { | 886 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) { |
| 887 aura::RootWindow::GetInstance()->GetDispatcher()->Dispatch(xev); | 887 aura::RootWindow::GetInstance()->GetDispatcher()->Dispatch(xev); |
| 888 return base::MessagePumpDispatcher::EVENT_QUIT; | 888 return base::MessagePumpDispatcher::EVENT_QUIT; |
| 889 } | 889 } |
| 890 switch (ui::EventTypeFromNative(xev)) { | 890 switch (ui::EventTypeFromNative(xev)) { |
| 891 case ui::ET_KEY_PRESSED: | 891 case ui::ET_KEY_PRESSED: |
| 892 OnKeyDown(ui::KeyboardCodeFromNative(xev)); | 892 if (!OnKeyDown(ui::KeyboardCodeFromNative(xev))) |
| 893 // OnKeyDown may have set exit_type_. | |
| 894 if (exit_type_ != EXIT_NONE) | |
| 895 return base::MessagePumpDispatcher::EVENT_QUIT; | 893 return base::MessagePumpDispatcher::EVENT_QUIT; |
| 896 | 894 |
| 897 // TODO(oshima): support SelectChar | 895 // TODO(oshima): support SelectChar |
| 898 break; | 896 // See http://crbug.com/107869 |
|
oshima
2011/12/16 18:21:33
nit: period at the end of both lines.
jennyz
2011/12/16 18:26:39
Done.
| |
| 897 | |
| 898 return base::MessagePumpDispatcher::EVENT_PROCESSED; | |
| 899 case ui::ET_KEY_RELEASED: | 899 case ui::ET_KEY_RELEASED: |
| 900 return base::MessagePumpDispatcher::EVENT_PROCESSED; | 900 return base::MessagePumpDispatcher::EVENT_PROCESSED; |
| 901 default: | 901 default: |
| 902 break; | 902 break; |
| 903 } | 903 } |
| 904 | 904 |
| 905 // TODO(oshima): Update Windows' Dispatcher to return DispatchStatus | 905 // TODO(oshima): Update Windows' Dispatcher to return DispatchStatus |
| 906 // instead of bool. | 906 // instead of bool. |
| 907 if (aura::RootWindow::GetInstance()->GetDispatcher()->Dispatch(xev) == | 907 if (aura::RootWindow::GetInstance()->GetDispatcher()->Dispatch(xev) == |
| 908 base::MessagePumpDispatcher::EVENT_IGNORED) | 908 base::MessagePumpDispatcher::EVENT_IGNORED) |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1946 // is necessary to exit from nested loop (See Dispatch methods). | 1946 // is necessary to exit from nested loop (See Dispatch methods). |
| 1947 // Send non-op event so that Dispatch method will always be called. | 1947 // Send non-op event so that Dispatch method will always be called. |
| 1948 // crbug.com/104684. | 1948 // crbug.com/104684. |
| 1949 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) | 1949 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) |
| 1950 aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent()); | 1950 aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent()); |
| 1951 #endif | 1951 #endif |
| 1952 } | 1952 } |
| 1953 | 1953 |
| 1954 | 1954 |
| 1955 } // namespace views | 1955 } // namespace views |
| OLD | NEW |