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

Side by Side Diff: views/controls/menu/menu_host_gtk.cc

Issue 6693010: Use extension to show activation message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 9 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 | « content/browser/tab_contents/interstitial_page.cc ('k') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/menu/menu_host_gtk.h" 5 #include "views/controls/menu/menu_host_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 8
9 #if defined(HAVE_XINPUT2) && defined(TOUCH_UI) 9 #if defined(HAVE_XINPUT2) && defined(TOUCH_UI)
10 #include <gdk/gdkx.h> 10 #include <gdk/gdkx.h>
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // events from other apps. 155 // events from other apps.
156 GdkGrabStatus pointer_grab_status = 156 GdkGrabStatus pointer_grab_status =
157 gdk_pointer_grab(window_contents()->window, FALSE, 157 gdk_pointer_grab(window_contents()->window, FALSE,
158 static_cast<GdkEventMask>( 158 static_cast<GdkEventMask>(
159 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | 159 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
160 GDK_POINTER_MOTION_MASK), 160 GDK_POINTER_MOTION_MASK),
161 NULL, NULL, GDK_CURRENT_TIME); 161 NULL, NULL, GDK_CURRENT_TIME);
162 GdkGrabStatus keyboard_grab_status = 162 GdkGrabStatus keyboard_grab_status =
163 gdk_keyboard_grab(window_contents()->window, FALSE, 163 gdk_keyboard_grab(window_contents()->window, FALSE,
164 GDK_CURRENT_TIME); 164 GDK_CURRENT_TIME);
165 if (pointer_grab_status == GDK_GRAB_NOT_VIEWABLE) {
zel 2011/03/15 18:39:45 does this file belong in this CL? does not seem re
166 DCHECK_EQ(GDK_GRAB_NOT_VIEWABLE, keyboard_grab_status);
167 GtkWidget* current_grab_window = gtk_grab_get_current();
168 if (current_grab_window)
169 gtk_grab_remove(current_grab_window);
170 return;
171 }
165 172
166 did_input_grab_ = pointer_grab_status == GDK_GRAB_SUCCESS && 173 did_input_grab_ = pointer_grab_status == GDK_GRAB_SUCCESS &&
167 keyboard_grab_status == GDK_GRAB_SUCCESS; 174 keyboard_grab_status == GDK_GRAB_SUCCESS;
168 175
169 #if defined(HAVE_XINPUT2) && defined(TOUCH_UI) 176 #if defined(HAVE_XINPUT2) && defined(TOUCH_UI)
170 ::Window window = GDK_WINDOW_XID(window_contents()->window); 177 ::Window window = GDK_WINDOW_XID(window_contents()->window);
171 Display* display = GDK_WINDOW_XDISPLAY(window_contents()->window); 178 Display* display = GDK_WINDOW_XDISPLAY(window_contents()->window);
172 bool xi2grab = TouchFactory::GetInstance()->GrabTouchDevices(display, window); 179 bool xi2grab = TouchFactory::GetInstance()->GrabTouchDevices(display, window);
173 did_input_grab_ = did_input_grab_ && xi2grab; 180 did_input_grab_ = did_input_grab_ && xi2grab;
174 #endif 181 #endif
175 182
176 DCHECK(did_input_grab_); 183 DCHECK_EQ(GDK_GRAB_SUCCESS, pointer_grab_status);
184 DCHECK_EQ(GDK_GRAB_SUCCESS, keyboard_grab_status);
177 // need keyboard grab. 185 // need keyboard grab.
178 } 186 }
179 187
180 } // namespace views 188 } // namespace views
OLDNEW
« no previous file with comments | « content/browser/tab_contents/interstitial_page.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698