OLD | NEW |
---|---|
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 #ifndef CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 | 96 |
97 // Sets the text of |status_label_| with the correct color. | 97 // Sets the text of |status_label_| with the correct color. |
98 void UpdateStatusLabel(const std::string& status_text); | 98 void UpdateStatusLabel(const std::string& status_text); |
99 | 99 |
100 // Sets the components of the danger warning. | 100 // Sets the components of the danger warning. |
101 void UpdateDangerWarning(); | 101 void UpdateDangerWarning(); |
102 | 102 |
103 // Sets the icon for the danger warning dialog. | 103 // Sets the icon for the danger warning dialog. |
104 void UpdateDangerIcon(); | 104 void UpdateDangerIcon(); |
105 | 105 |
106 void ShowDangerPrompt(); | |
107 | |
106 static void InitNineBoxes(); | 108 static void InitNineBoxes(); |
107 | 109 |
108 // Show popup context menu. If |button| is not NULL, show the menu dropping | 110 // Show popup context menu. If |button| is not NULL, show the menu dropping |
109 // down from |button|. Otherwise, show the menu where the user clicks. | 111 // down from |button|. Otherwise, show the menu where the user clicks. |
110 void ShowPopupMenu(GtkWidget* button, GdkEventButton* event); | 112 void ShowPopupMenu(GtkWidget* button, GdkEventButton* event); |
111 | 113 |
112 // Draws everything in GTK rendering mode. | 114 // Draws everything in GTK rendering mode. |
113 CHROMEGTK_CALLBACK_1(DownloadItemGtk, gboolean, OnHboxExpose, | 115 CHROMEGTK_CALLBACK_1(DownloadItemGtk, gboolean, OnHboxExpose, |
114 GdkEventExpose*); | 116 GdkEventExpose*); |
115 | 117 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 GtkWidget* dangerous_label_; | 208 GtkWidget* dangerous_label_; |
207 | 209 |
208 // An hbox for holding components of the dangerous download dialog. | 210 // An hbox for holding components of the dangerous download dialog. |
209 ui::OwnedWidgetGtk dangerous_hbox_; | 211 ui::OwnedWidgetGtk dangerous_hbox_; |
210 int dangerous_hbox_start_width_; | 212 int dangerous_hbox_start_width_; |
211 int dangerous_hbox_full_width_; | 213 int dangerous_hbox_full_width_; |
212 | 214 |
213 // The animation when this item is first added to the shelf. | 215 // The animation when this item is first added to the shelf. |
214 scoped_ptr<ui::SlideAnimation> new_item_animation_; | 216 scoped_ptr<ui::SlideAnimation> new_item_animation_; |
215 | 217 |
218 // The animation when the download item transitions to the dangerous prompt. | |
219 scoped_ptr<ui::SlideAnimation> danger_prompt_animation_; | |
Randy Smith (Not in Mondays)
2011/11/21 01:38:13
Is there a reason we don't have the contrary anima
| |
220 | |
216 // Progress animation. | 221 // Progress animation. |
217 base::RepeatingTimer<DownloadItemGtk> progress_timer_; | 222 base::RepeatingTimer<DownloadItemGtk> progress_timer_; |
218 | 223 |
219 // Animation for download complete. | 224 // Animation for download complete. |
220 ui::SlideAnimation complete_animation_; | 225 ui::SlideAnimation complete_animation_; |
221 | 226 |
222 // The file icon for the download. May be null. The small version is used | 227 // The file icon for the download. May be null. The small version is used |
223 // for display in the shelf; the large version is for use as a drag icon. | 228 // for display in the shelf; the large version is for use as a drag icon. |
224 // These icons are owned by the IconManager (owned by the BrowserProcess). | 229 // These icons are owned by the IconManager (owned by the BrowserProcess). |
225 gfx::Image* icon_small_; | 230 gfx::Image* icon_small_; |
226 gfx::Image* icon_large_; | 231 gfx::Image* icon_large_; |
227 | 232 |
228 // The last download file path for which we requested an icon. | 233 // The last download file path for which we requested an icon. |
229 FilePath icon_filepath_; | 234 FilePath icon_filepath_; |
230 | 235 |
231 content::NotificationRegistrar registrar_; | 236 content::NotificationRegistrar registrar_; |
232 | 237 |
233 // The time at which we were insantiated. | 238 // The time at which we were insantiated. |
234 base::Time creation_time_; | 239 base::Time creation_time_; |
235 | 240 |
236 // For canceling an in progress icon request. | 241 // For canceling an in progress icon request. |
237 CancelableRequestConsumerT<int, 0> icon_consumer_; | 242 CancelableRequestConsumerT<int, 0> icon_consumer_; |
238 | 243 |
239 // Indicates when the download has completed, so we don't redo | 244 // Indicates when the download has completed, so we don't redo |
240 // on-completion actions. | 245 // on-completion actions. |
241 bool download_complete_; | 246 bool download_complete_; |
242 }; | 247 }; |
243 | 248 |
244 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_GTK_H_ | 249 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_GTK_H_ |
OLD | NEW |