| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/download_item_gtk.h" | 5 #include "chrome/browser/gtk/download_item_gtk.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/gfx/canvas_paint.h" | 8 #include "app/gfx/canvas_paint.h" |
| 9 #include "app/gfx/font.h" | 9 #include "app/gfx/font.h" |
| 10 #include "app/gfx/text_elider.h" | 10 #include "app/gfx/text_elider.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 { MENU_NORMAL, CANCEL, IDS_DOWNLOAD_MENU_CANCEL, 0, NULL}, | 161 { MENU_NORMAL, CANCEL, IDS_DOWNLOAD_MENU_CANCEL, 0, NULL}, |
| 162 { MENU_END, 0, 0, 0, NULL }, | 162 { MENU_END, 0, 0, 0, NULL }, |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 MenuCreateMaterial DownloadShelfContextMenuGtk::in_progress_download_menu[] = { | 165 MenuCreateMaterial DownloadShelfContextMenuGtk::in_progress_download_menu[] = { |
| 166 { MENU_CHECKBOX, OPEN_WHEN_COMPLETE, IDS_DOWNLOAD_MENU_OPEN_WHEN_COMPLETE, | 166 { MENU_CHECKBOX, OPEN_WHEN_COMPLETE, IDS_DOWNLOAD_MENU_OPEN_WHEN_COMPLETE, |
| 167 0, NULL }, | 167 0, NULL }, |
| 168 { MENU_CHECKBOX, ALWAYS_OPEN_TYPE, IDS_DOWNLOAD_MENU_ALWAYS_OPEN_TYPE, | 168 { MENU_CHECKBOX, ALWAYS_OPEN_TYPE, IDS_DOWNLOAD_MENU_ALWAYS_OPEN_TYPE, |
| 169 0, NULL}, | 169 0, NULL}, |
| 170 { MENU_SEPARATOR, 0, 0, 0, NULL }, | 170 { MENU_SEPARATOR, 0, 0, 0, NULL }, |
| 171 { MENU_CHECKBOX, TOGGLE_PAUSE, IDS_DOWNLOAD_MENU_PAUSE_ITEM, 0, NULL}, |
| 171 { MENU_NORMAL, SHOW_IN_FOLDER, IDS_DOWNLOAD_LINK_SHOW, 0, NULL}, | 172 { MENU_NORMAL, SHOW_IN_FOLDER, IDS_DOWNLOAD_LINK_SHOW, 0, NULL}, |
| 172 { MENU_SEPARATOR, 0, 0, 0, NULL }, | 173 { MENU_SEPARATOR, 0, 0, 0, NULL }, |
| 173 { MENU_NORMAL, REMOVE_ITEM, IDS_DOWNLOAD_MENU_REMOVE_ITEM, 0, NULL}, | 174 { MENU_NORMAL, REMOVE_ITEM, IDS_DOWNLOAD_MENU_REMOVE_ITEM, 0, NULL}, |
| 174 { MENU_NORMAL, CANCEL, IDS_DOWNLOAD_MENU_CANCEL, 0, NULL}, | 175 { MENU_NORMAL, CANCEL, IDS_DOWNLOAD_MENU_CANCEL, 0, NULL}, |
| 175 { MENU_END, 0, 0, 0, NULL }, | 176 { MENU_END, 0, 0, 0, NULL }, |
| 176 }; | 177 }; |
| 177 | 178 |
| 178 // DownloadItemGtk ------------------------------------------------------------- | 179 // DownloadItemGtk ------------------------------------------------------------- |
| 179 | 180 |
| 180 NineBox* DownloadItemGtk::body_nine_box_normal_ = NULL; | 181 NineBox* DownloadItemGtk::body_nine_box_normal_ = NULL; |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 | 872 |
| 872 // static | 873 // static |
| 873 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button, | 874 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button, |
| 874 DownloadItemGtk* item) { | 875 DownloadItemGtk* item) { |
| 875 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", | 876 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", |
| 876 base::Time::Now() - item->creation_time_); | 877 base::Time::Now() - item->creation_time_); |
| 877 if (item->get_download()->state() == DownloadItem::IN_PROGRESS) | 878 if (item->get_download()->state() == DownloadItem::IN_PROGRESS) |
| 878 item->get_download()->Cancel(true); | 879 item->get_download()->Cancel(true); |
| 879 item->get_download()->Remove(true); | 880 item->get_download()->Remove(true); |
| 880 } | 881 } |
| OLD | NEW |