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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 11779035: Centralize keypress listener handling in non-platform-specific code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep ignoring input events Created 7 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_gtk.h" 5 #include "content/browser/renderer_host/render_widget_host_view_gtk.h"
6 6
7 // If this gets included after the gtk headers, then a bunch of compiler 7 // If this gets included after the gtk headers, then a bunch of compiler
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts
9 // badly with net::URLRequestStatus::Status. 9 // badly with net::URLRequestStatus::Status.
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 RenderWidgetHostViewGtk* host_view) { 217 RenderWidgetHostViewGtk* host_view) {
218 TRACE_EVENT0("browser", 218 TRACE_EVENT0("browser",
219 "RenderWidgetHostViewGtkWidget::OnKeyPressReleaseEvent"); 219 "RenderWidgetHostViewGtkWidget::OnKeyPressReleaseEvent");
220 // Force popups or fullscreen windows to close on Escape so they won't keep 220 // Force popups or fullscreen windows to close on Escape so they won't keep
221 // the keyboard grabbed or be stuck onscreen if the renderer is hanging. 221 // the keyboard grabbed or be stuck onscreen if the renderer is hanging.
222 bool should_close_on_escape = 222 bool should_close_on_escape =
223 (host_view->IsPopup() && host_view->NeedsInputGrab()) || 223 (host_view->IsPopup() && host_view->NeedsInputGrab()) ||
224 host_view->is_fullscreen_; 224 host_view->is_fullscreen_;
225 if (should_close_on_escape && GDK_Escape == event->keyval) { 225 if (should_close_on_escape && GDK_Escape == event->keyval) {
226 host_view->host_->Shutdown(); 226 host_view->host_->Shutdown();
227 } else if (host_view->host_ &&
228 host_view->host_->KeyPressListenersHandleEvent(
229 NativeWebKeyboardEvent(reinterpret_cast<GdkEvent*>(
230 event)))) {
231 return TRUE;
232 } else { 227 } else {
233 // Send key event to input method. 228 // Send key event to input method.
234 host_view->im_context_->ProcessKeyEvent(event); 229 host_view->im_context_->ProcessKeyEvent(event);
235 } 230 }
236 231
237 // We return TRUE because we did handle the event. If it turns out webkit 232 // We return TRUE because we did handle the event. If it turns out webkit
238 // can't handle the event, we'll deal with it in 233 // can't handle the event, we'll deal with it in
239 // RenderView::UnhandledKeyboardEvent(). 234 // RenderView::UnhandledKeyboardEvent().
240 return TRUE; 235 return TRUE;
241 } 236 }
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 this)); 1546 this));
1552 } 1547 }
1553 BrowserAccessibilityGtk* root = 1548 BrowserAccessibilityGtk* root =
1554 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk(); 1549 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk();
1555 1550
1556 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER); 1551 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER);
1557 return root->GetAtkObject(); 1552 return root->GetAtkObject();
1558 } 1553 }
1559 1554
1560 } // namespace content 1555 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/browser/renderer_host/render_widget_host_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698