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

Unified Diff: chrome/browser/gtk/download_item_gtk.cc

Issue 112064: Linux: call xdg-open on downloaded files to open them. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix typos Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/download_item_gtk.h ('k') | chrome/common/platform_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/download_item_gtk.cc
===================================================================
--- chrome/browser/gtk/download_item_gtk.cc (revision 17041)
+++ chrome/browser/gtk/download_item_gtk.cc (working copy)
@@ -181,6 +181,8 @@
gtk_widget_set_app_paintable(body_, TRUE);
g_signal_connect(body_, "expose-event",
G_CALLBACK(OnExpose), this);
+ g_signal_connect(body_, "clicked",
+ G_CALLBACK(OnClick), this);
GTK_WIDGET_UNSET_FLAGS(body_, GTK_CAN_FOCUS);
// Remove internal padding on the button.
GtkRcStyle* no_padding_style = gtk_rc_style_new();
@@ -565,6 +567,19 @@
}
// static
+void DownloadItemGtk::OnClick(GtkWidget* widget, DownloadItemGtk* item) {
+ DownloadItem* download = item->get_download();
+
+ // TODO(estade): add clickjacking histogram stuff.
+ if (download->state() == DownloadItem::IN_PROGRESS) {
+ download->set_open_when_complete(
+ !download->open_when_complete());
+ } else if (download->state() == DownloadItem::COMPLETE) {
+ download_util::OpenDownload(download);
+ }
+}
+
+// static
gboolean DownloadItemGtk::OnProgressAreaExpose(GtkWidget* widget,
GdkEventExpose* event, DownloadItemGtk* download_item) {
// Create a transparent canvas.
« no previous file with comments | « chrome/browser/gtk/download_item_gtk.h ('k') | chrome/common/platform_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698