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

Side by Side Diff: chrome/browser/ui/gtk/gtk_util.cc

Issue 6249022: Make the gtk download shelf autoclose on mouse out. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fewer changes Created 9 years, 10 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) 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/ui/gtk/gtk_util.h" 5 #include "chrome/browser/ui/gtk/gtk_util.h"
6 6
7 #include <cairo/cairo.h> 7 #include <cairo/cairo.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 465
466 gfx::Point GetWidgetScreenPosition(GtkWidget* widget) { 466 gfx::Point GetWidgetScreenPosition(GtkWidget* widget) {
467 if (!widget->window) { 467 if (!widget->window) {
468 NOTREACHED() << "Must only be called on realized widgets."; 468 NOTREACHED() << "Must only be called on realized widgets.";
469 return gfx::Point(0, 0); 469 return gfx::Point(0, 0);
470 } 470 }
471 471
472 gint x, y; 472 gint x, y;
473 gdk_window_get_origin(widget->window, &x, &y); 473 gdk_window_get_origin(widget->window, &x, &y);
474 474
475 if (!GTK_IS_WINDOW(widget)) { 475 if (GTK_WIDGET_NO_WINDOW(widget)) {
476 x += widget->allocation.x; 476 x += widget->allocation.x;
477 y += widget->allocation.y; 477 y += widget->allocation.y;
478 } 478 }
479 479
480 return gfx::Point(x, y); 480 return gfx::Point(x, y);
481 } 481 }
482 482
483 gfx::Rect GetWidgetScreenBounds(GtkWidget* widget) { 483 gfx::Rect GetWidgetScreenBounds(GtkWidget* widget) {
484 gfx::Point position = GetWidgetScreenPosition(widget); 484 gfx::Point position = GetWidgetScreenPosition(widget);
485 return gfx::Rect(position.x(), position.y(), 485 return gfx::Rect(position.x(), position.y(),
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 1241
1242 void DoCopy(BrowserWindow* window) { 1242 void DoCopy(BrowserWindow* window) {
1243 DoCutCopyPaste(window, &RenderViewHost::Copy, "copy-clipboard"); 1243 DoCutCopyPaste(window, &RenderViewHost::Copy, "copy-clipboard");
1244 } 1244 }
1245 1245
1246 void DoPaste(BrowserWindow* window) { 1246 void DoPaste(BrowserWindow* window) {
1247 DoCutCopyPaste(window, &RenderViewHost::Paste, "paste-clipboard"); 1247 DoCutCopyPaste(window, &RenderViewHost::Paste, "paste-clipboard");
1248 } 1248 }
1249 1249
1250 } // namespace gtk_util 1250 } // namespace gtk_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/download_shelf_gtk.cc ('k') | chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698