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

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

Issue 8965013: Fix the issue that omnibox is editable when menu is opened in aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address code review comments. Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 return base::MessagePumpDispatcher::EVENT_QUIT;
894
893 // OnKeyDown may have set exit_type_. 895 // OnKeyDown may have set exit_type_.
894 if (exit_type_ != EXIT_NONE) 896 if (exit_type_ != EXIT_NONE)
sky 2011/12/16 17:22:16 This shouldn't be needed anymore.
jennyz 2011/12/16 17:29:30 Done.
895 return base::MessagePumpDispatcher::EVENT_QUIT; 897 return base::MessagePumpDispatcher::EVENT_QUIT;
896 898
897 // TODO(oshima): support SelectChar 899 // TODO(oshima): support SelectChar
898 break; 900 // See http://crbug.com/107869
901
902 return base::MessagePumpDispatcher::EVENT_PROCESSED;
899 case ui::ET_KEY_RELEASED: 903 case ui::ET_KEY_RELEASED:
900 return base::MessagePumpDispatcher::EVENT_PROCESSED; 904 return base::MessagePumpDispatcher::EVENT_PROCESSED;
901 default: 905 default:
902 break; 906 break;
903 } 907 }
904 908
905 // TODO(oshima): Update Windows' Dispatcher to return DispatchStatus 909 // TODO(oshima): Update Windows' Dispatcher to return DispatchStatus
906 // instead of bool. 910 // instead of bool.
907 if (aura::RootWindow::GetInstance()->GetDispatcher()->Dispatch(xev) == 911 if (aura::RootWindow::GetInstance()->GetDispatcher()->Dispatch(xev) ==
908 base::MessagePumpDispatcher::EVENT_IGNORED) 912 base::MessagePumpDispatcher::EVENT_IGNORED)
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 // is necessary to exit from nested loop (See Dispatch methods). 1950 // is necessary to exit from nested loop (See Dispatch methods).
1947 // Send non-op event so that Dispatch method will always be called. 1951 // Send non-op event so that Dispatch method will always be called.
1948 // crbug.com/104684. 1952 // crbug.com/104684.
1949 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) 1953 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED)
1950 aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent()); 1954 aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent());
1951 #endif 1955 #endif
1952 } 1956 }
1953 1957
1954 1958
1955 } // namespace views 1959 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698