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

Side by Side Diff: views/widget/widget_gtk.h

Issue 2682004: MessageBubble which does not require separate window and does not grab input on mouse press event. (Closed)
Patch Set: moved HandleGrabBroke to protected section Created 10 years, 6 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
« no previous file with comments | « chrome/browser/views/info_bubble.cc ('k') | views/widget/widget_gtk.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) 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 #ifndef VIEWS_WIDGET_WIDGET_GTK_H_ 5 #ifndef VIEWS_WIDGET_WIDGET_GTK_H_
6 #define VIEWS_WIDGET_WIDGET_GTK_H_ 6 #define VIEWS_WIDGET_WIDGET_GTK_H_
7 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "app/active_window_watcher_x.h" 10 #include "app/active_window_watcher_x.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 void set_mouse_down(bool mouse_down) { is_mouse_down_ = mouse_down; } 263 void set_mouse_down(bool mouse_down) { is_mouse_down_ = mouse_down; }
264 264
265 // Do we own the mouse grab? 265 // Do we own the mouse grab?
266 bool has_capture() const { return has_capture_; } 266 bool has_capture() const { return has_capture_; }
267 267
268 // Returns whether capture should be released on mouse release. The default 268 // Returns whether capture should be released on mouse release. The default
269 // is true. 269 // is true.
270 virtual bool ReleaseCaptureOnMouseReleased() { return true; } 270 virtual bool ReleaseCaptureOnMouseReleased() { return true; }
271 271
272 // Does a mouse grab on this widget. 272 // Does a mouse grab on this widget.
273 void DoGrab(); 273 virtual void DoGrab();
274 274
275 // Releases a grab done by this widget. 275 // Releases a grab done by this widget.
276 virtual void ReleaseGrab(); 276 virtual void ReleaseGrab();
277 277
278 // Invoked when input grab is stolen by other GtkWidget in the same
279 // application.
280 virtual void HandleGrabBroke();
281
278 // Are we a subclass of WindowGtk? 282 // Are we a subclass of WindowGtk?
279 bool is_window_; 283 bool is_window_;
280 284
281 // For test code to provide a customized focus manager. 285 // For test code to provide a customized focus manager.
282 void set_focus_manager(FocusManager* focus_manager) { 286 void set_focus_manager(FocusManager* focus_manager) {
283 delete focus_manager_; 287 delete focus_manager_;
284 focus_manager_ = focus_manager; 288 focus_manager_ = focus_manager;
285 } 289 }
286 290
287 private: 291 private:
(...skipping 21 matching lines...) Expand all
309 // Invoked from create widget to enable the various bits needed for a 313 // Invoked from create widget to enable the various bits needed for a
310 // transparent background. This is only invoked if MakeTransparent has been 314 // transparent background. This is only invoked if MakeTransparent has been
311 // invoked. 315 // invoked.
312 void ConfigureWidgetForTransparentBackground(GtkWidget* parent); 316 void ConfigureWidgetForTransparentBackground(GtkWidget* parent);
313 317
314 // Invoked from create widget to enable the various bits needed for a 318 // Invoked from create widget to enable the various bits needed for a
315 // window which doesn't receive events. This is only invoked if 319 // window which doesn't receive events. This is only invoked if
316 // MakeIgnoreEvents has been invoked. 320 // MakeIgnoreEvents has been invoked.
317 void ConfigureWidgetForIgnoreEvents(); 321 void ConfigureWidgetForIgnoreEvents();
318 322
319 // TODO(sky): documentation
320 void HandleGrabBroke();
321
322 // A utility function to draw a transparent background onto the |widget|. 323 // A utility function to draw a transparent background onto the |widget|.
323 static void DrawTransparentBackground(GtkWidget* widget, 324 static void DrawTransparentBackground(GtkWidget* widget,
324 GdkEventExpose* event); 325 GdkEventExpose* event);
325 326
326 const Type type_; 327 const Type type_;
327 328
328 // Our native views. If we're a window/popup, then widget_ is the window and 329 // Our native views. If we're a window/popup, then widget_ is the window and
329 // window_contents_ is a GtkFixed. If we're not a window/popup, then widget_ 330 // window_contents_ is a GtkFixed. If we're not a window/popup, then widget_
330 // and window_contents_ point to the same GtkFixed. 331 // and window_contents_ point to the same GtkFixed.
331 GtkWidget* widget_; 332 GtkWidget* widget_;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // If true, we enable the content widget's double buffering. 435 // If true, we enable the content widget's double buffering.
435 // This is false by default. 436 // This is false by default.
436 bool is_double_buffered_; 437 bool is_double_buffered_;
437 438
438 DISALLOW_COPY_AND_ASSIGN(WidgetGtk); 439 DISALLOW_COPY_AND_ASSIGN(WidgetGtk);
439 }; 440 };
440 441
441 } // namespace views 442 } // namespace views
442 443
443 #endif // VIEWS_WIDGET_WIDGET_GTK_H_ 444 #endif // VIEWS_WIDGET_WIDGET_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/views/info_bubble.cc ('k') | views/widget/widget_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698