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

Side by Side Diff: chrome/browser/extensions/extension_input_api.cc

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resore most InputMethod code. Created 9 years, 8 months 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 | views/focus/accelerator_handler_touch.cc » ('j') | 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 "chrome/browser/extensions/extension_input_api.h" 5 #include "chrome/browser/extensions/extension_input_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 flags |= shift ? ui::EF_SHIFT_DOWN : 0; 108 flags |= shift ? ui::EF_SHIFT_DOWN : 0;
109 bool meta = false; 109 bool meta = false;
110 if (args->GetBoolean(kMeta, &meta)) { 110 if (args->GetBoolean(kMeta, &meta)) {
111 // Views does not have a Meta event flag, so return an error for now. 111 // Views does not have a Meta event flag, so return an error for now.
112 if (meta) { 112 if (meta) {
113 error_ = kUnsupportedModifier; 113 error_ = kUnsupportedModifier;
114 return false; 114 return false;
115 } 115 }
116 } 116 }
117 117
118 views::RootView* root_view = GetRootView(); 118 views::RootView* root_view = GetRootView();
Ben Goodger (Google) 2011/04/20 23:12:05 RootView is going to become an internal implementa
msw 2011/04/21 19:19:24 Done.
119 if (!root_view) { 119 if (!root_view) {
120 error_ = kNoValidRecipientError; 120 error_ = kNoValidRecipientError;
121 return false; 121 return false;
122 } 122 }
123 123
124 views::KeyEvent event(type, prototype_event.key_code(), flags); 124 views::KeyEvent event(type, prototype_event.key_code(), flags);
125 views::InputMethod* ime = root_view->GetWidget()->GetInputMethod(); 125 views::InputMethod* ime = root_view->GetWidget()->GetInputMethod();
126 if (ime) { 126 if (ime) {
127 ime->DispatchKeyEvent(event); 127 ime->DispatchKeyEvent(event);
128 } else if (!root_view->ProcessKeyEvent(event)) { 128 } else if (!root_view->OnKeyEvent(event)) {
129 error_ = kKeyEventUnprocessedError; 129 error_ = kKeyEventUnprocessedError;
130 return false; 130 return false;
131 } 131 }
132 132
133 return true; 133 return true;
134 } 134 }
OLDNEW
« no previous file with comments | « no previous file | views/focus/accelerator_handler_touch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698