summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/download_item_gtk.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 23:52:32 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 23:52:32 +0000
commita0a9577b170540cf58981def1c1616070afbd06f (patch)
tree15ae29176225715048d6fc98dd0598717ae9c78a /chrome/browser/gtk/download_item_gtk.h
parent9d4d1e4dff1bb10542adbdf568b3920f2ba47a4a (diff)
downloadchromium_src-a0a9577b170540cf58981def1c1616070afbd06f.zip
chromium_src-a0a9577b170540cf58981def1c1616070afbd06f.tar.gz
chromium_src-a0a9577b170540cf58981def1c1616070afbd06f.tar.bz2
Dangerous download dialog for linux.
BUG=11780 TEST=go to cygwin.com, click "install or update now". The download shelf should appear with a dangerous download dialog, which should animate properly and without undue jank. Clicking "cancel" should delete the item and hide the shelf (since it's the only thing in the shelf). Clicking "save" should make it become a normal download item. Review URL: http://codereview.chromium.org/113920 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/download_item_gtk.h')
-rw-r--r--chrome/browser/gtk/download_item_gtk.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.h b/chrome/browser/gtk/download_item_gtk.h
index 0a8a09cd..fba3a8a 100644
--- a/chrome/browser/gtk/download_item_gtk.h
+++ b/chrome/browser/gtk/download_item_gtk.h
@@ -44,6 +44,11 @@ class DownloadItemGtk : public DownloadItem::Observer,
private:
friend class DownloadShelfContextMenuGtk;
+ DownloadItem* get_download();
+
+ // Returns true IFF the download is dangerous and unconfirmed.
+ bool IsDangerous();
+
// Functions for controlling the progress animation.
// Repaint the download progress.
void UpdateDownloadProgress();
@@ -76,6 +81,14 @@ class DownloadItemGtk : public DownloadItem::Observer,
GtkAllocation *allocation,
DownloadItemGtk* item);
+ // Dangerous download related. -----------------------------------------------
+ static gboolean OnDangerousPromptExpose(GtkWidget* widget,
+ GdkEventExpose* event,
+ DownloadItemGtk* item);
+
+ static void OnDangerousAccept(GtkWidget* button, DownloadItemGtk* item);
+ static void OnDangerousDecline(GtkWidget* button, DownloadItemGtk* item);
+
// Nineboxes for the body area.
static NineBox* body_nine_box_normal_;
static NineBox* body_nine_box_prelight_;
@@ -86,6 +99,9 @@ class DownloadItemGtk : public DownloadItem::Observer,
static NineBox* menu_nine_box_prelight_;
static NineBox* menu_nine_box_active_;
+ // Ninebox for the background of the dangerous download prompt.
+ static NineBox* dangerous_nine_box_;
+
// The shelf on which we are displayed.
DownloadShelfGtk* parent_shelf_;
@@ -127,6 +143,13 @@ class DownloadItemGtk : public DownloadItem::Observer,
// We do not want to overlap it.
GtkWidget* bounding_widget_;
+ // The dangerous download dialog. This will be null for safe downloads.
+ GtkWidget* dangerous_prompt_;
+
+ // An hbox for holding components of the dangerous download dialog.
+ GtkWidget* dangerous_hbox_;
+ int dangerous_hbox_full_width_;
+
// The ID of the handler for the parent shelf's "size-allocate" event. We save
// it so we can disconnect when we are destroyed.
gulong resize_handler_id_;