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

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

Issue 8301021: Remove redundant 'escape to quit fullscreen/mouse lock' code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 9 years, 2 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 | content/browser/renderer_host/render_widget_host_view_win.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 "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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 GdkEventConfigure* event, 196 GdkEventConfigure* event,
197 RenderWidgetHostViewGtk* host_view) { 197 RenderWidgetHostViewGtk* host_view) {
198 host_view->widget_center_valid_ = false; 198 host_view->widget_center_valid_ = false;
199 host_view->mouse_has_been_warped_to_new_center_ = false; 199 host_view->mouse_has_been_warped_to_new_center_ = false;
200 return FALSE; 200 return FALSE;
201 } 201 }
202 202
203 static gboolean OnKeyPressReleaseEvent(GtkWidget* widget, 203 static gboolean OnKeyPressReleaseEvent(GtkWidget* widget,
204 GdkEventKey* event, 204 GdkEventKey* event,
205 RenderWidgetHostViewGtk* host_view) { 205 RenderWidgetHostViewGtk* host_view) {
206 // ESC exits mouse lock.
207 if (host_view->mouse_locked_ && event->keyval == GDK_Escape) {
208 host_view->UnlockMouse();
209 return TRUE;
210 }
211 // Force popups or fullscreen windows to close on Escape so they won't keep 206 // Force popups or fullscreen windows to close on Escape so they won't keep
212 // the keyboard grabbed or be stuck onscreen if the renderer is hanging. 207 // the keyboard grabbed or be stuck onscreen if the renderer is hanging.
213 bool should_close_on_escape = 208 bool should_close_on_escape =
214 (host_view->IsPopup() && host_view->NeedsInputGrab()) || 209 (host_view->IsPopup() && host_view->NeedsInputGrab()) ||
215 host_view->is_fullscreen_; 210 host_view->is_fullscreen_;
216 if (should_close_on_escape && GDK_Escape == event->keyval) { 211 if (should_close_on_escape && GDK_Escape == event->keyval) {
217 host_view->host_->Shutdown(); 212 host_view->host_->Shutdown();
218 } else { 213 } else {
219 // Send key event to input method. 214 // Send key event to input method.
220 host_view->im_context_->ProcessKeyEvent(event); 215 host_view->im_context_->ProcessKeyEvent(event);
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 } 1392 }
1398 } 1393 }
1399 1394
1400 // static 1395 // static
1401 void RenderWidgetHostView::GetDefaultScreenInfo( 1396 void RenderWidgetHostView::GetDefaultScreenInfo(
1402 WebKit::WebScreenInfo* results) { 1397 WebKit::WebScreenInfo* results) {
1403 GdkWindow* gdk_window = 1398 GdkWindow* gdk_window =
1404 gdk_display_get_default_group(gdk_display_get_default()); 1399 gdk_display_get_default_group(gdk_display_get_default());
1405 content::GetScreenInfoFromNativeWindow(gdk_window, results); 1400 content::GetScreenInfoFromNativeWindow(gdk_window, results);
1406 } 1401 }
OLDNEW
« no previous file with comments | « no previous file | 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