| 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 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "chrome/browser/icon_manager.h" | 15 #include "chrome/browser/icon_manager.h" |
| 16 #include "chrome/browser/ui/gtk/owned_widget_gtk.h" | |
| 17 #include "content/browser/download/download_item.h" | 16 #include "content/browser/download/download_item.h" |
| 18 #include "content/common/notification_observer.h" | 17 #include "content/common/notification_observer.h" |
| 19 #include "content/common/notification_registrar.h" | 18 #include "content/common/notification_registrar.h" |
| 20 #include "ui/base/animation/animation_delegate.h" | 19 #include "ui/base/animation/animation_delegate.h" |
| 21 #include "ui/base/animation/slide_animation.h" | 20 #include "ui/base/animation/slide_animation.h" |
| 22 #include "ui/base/gtk/gtk_signal.h" | 21 #include "ui/base/gtk/gtk_signal.h" |
| 22 #include "ui/base/gtk/owned_widget_gtk.h" |
| 23 | 23 |
| 24 class BaseDownloadItemModel; | 24 class BaseDownloadItemModel; |
| 25 class DownloadShelfContextMenuGtk; | 25 class DownloadShelfContextMenuGtk; |
| 26 class DownloadShelfGtk; | 26 class DownloadShelfGtk; |
| 27 class GtkThemeService; | 27 class GtkThemeService; |
| 28 class NineBox; | 28 class NineBox; |
| 29 class SkBitmap; | 29 class SkBitmap; |
| 30 | 30 |
| 31 namespace gfx { | 31 namespace gfx { |
| 32 class Image; | 32 class Image; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 static NineBox* menu_nine_box_prelight_; | 147 static NineBox* menu_nine_box_prelight_; |
| 148 static NineBox* menu_nine_box_active_; | 148 static NineBox* menu_nine_box_active_; |
| 149 | 149 |
| 150 // Ninebox for the background of the dangerous download prompt. | 150 // Ninebox for the background of the dangerous download prompt. |
| 151 static NineBox* dangerous_nine_box_; | 151 static NineBox* dangerous_nine_box_; |
| 152 | 152 |
| 153 // The shelf on which we are displayed. | 153 // The shelf on which we are displayed. |
| 154 DownloadShelfGtk* parent_shelf_; | 154 DownloadShelfGtk* parent_shelf_; |
| 155 | 155 |
| 156 // The widget that contains the body and menu dropdown. | 156 // The widget that contains the body and menu dropdown. |
| 157 OwnedWidgetGtk hbox_; | 157 ui::OwnedWidgetGtk hbox_; |
| 158 | 158 |
| 159 // The widget that contains the name of the download and the progress | 159 // The widget that contains the name of the download and the progress |
| 160 // animation. | 160 // animation. |
| 161 OwnedWidgetGtk body_; | 161 ui::OwnedWidgetGtk body_; |
| 162 | 162 |
| 163 // The widget that contains the texts of |name_label_| and |status_label_|. | 163 // The widget that contains the texts of |name_label_| and |status_label_|. |
| 164 GtkWidget* text_stack_; | 164 GtkWidget* text_stack_; |
| 165 | 165 |
| 166 // The GtkLabel that holds the download title text. | 166 // The GtkLabel that holds the download title text. |
| 167 GtkWidget* name_label_; | 167 GtkWidget* name_label_; |
| 168 | 168 |
| 169 // The GtkLabel that holds the status text. | 169 // The GtkLabel that holds the status text. |
| 170 GtkWidget* status_label_; | 170 GtkWidget* status_label_; |
| 171 | 171 |
| 172 // The current text of status label | 172 // The current text of status label |
| 173 std::string status_text_; | 173 std::string status_text_; |
| 174 | 174 |
| 175 // The widget that creates a dropdown menu when pressed. | 175 // The widget that creates a dropdown menu when pressed. |
| 176 GtkWidget* menu_button_; | 176 GtkWidget* menu_button_; |
| 177 | 177 |
| 178 // A gtk arrow pointing downward displayed in |menu_button_|. Only displayed | 178 // A gtk arrow pointing downward displayed in |menu_button_|. Only displayed |
| 179 // in GTK mode. | 179 // in GTK mode. |
| 180 GtkWidget* arrow_; | 180 GtkWidget* arrow_; |
| 181 | 181 |
| 182 // Whether the menu is currently showing for |menu_button_|. Affects how we | 182 // Whether the menu is currently showing for |menu_button_|. Affects how we |
| 183 // draw the button. | 183 // draw the button. |
| 184 bool menu_showing_; | 184 bool menu_showing_; |
| 185 | 185 |
| 186 // Whether we should use the GTK text color | 186 // Whether we should use the GTK text color |
| 187 GtkThemeService* theme_service_; | 187 GtkThemeService* theme_service_; |
| 188 | 188 |
| 189 // The widget that contains the animation progress and the file's icon | 189 // The widget that contains the animation progress and the file's icon |
| 190 // (as well as the complete animation). | 190 // (as well as the complete animation). |
| 191 OwnedWidgetGtk progress_area_; | 191 ui::OwnedWidgetGtk progress_area_; |
| 192 | 192 |
| 193 // In degrees. Only used for downloads with no known total size. | 193 // In degrees. Only used for downloads with no known total size. |
| 194 int progress_angle_; | 194 int progress_angle_; |
| 195 | 195 |
| 196 // The menu that pops down when the user presses |menu_button_|. We do not | 196 // The menu that pops down when the user presses |menu_button_|. We do not |
| 197 // create this until the first time we actually need it. | 197 // create this until the first time we actually need it. |
| 198 scoped_ptr<DownloadShelfContextMenuGtk> menu_; | 198 scoped_ptr<DownloadShelfContextMenuGtk> menu_; |
| 199 | 199 |
| 200 // The download item model we represent. | 200 // The download item model we represent. |
| 201 scoped_ptr<BaseDownloadItemModel> download_model_; | 201 scoped_ptr<BaseDownloadItemModel> download_model_; |
| 202 | 202 |
| 203 // The dangerous download dialog. This will be null for safe downloads. | 203 // The dangerous download dialog. This will be null for safe downloads. |
| 204 GtkWidget* dangerous_prompt_; | 204 GtkWidget* dangerous_prompt_; |
| 205 GtkWidget* dangerous_image_; | 205 GtkWidget* dangerous_image_; |
| 206 GtkWidget* dangerous_label_; | 206 GtkWidget* dangerous_label_; |
| 207 | 207 |
| 208 // An hbox for holding components of the dangerous download dialog. | 208 // An hbox for holding components of the dangerous download dialog. |
| 209 OwnedWidgetGtk dangerous_hbox_; | 209 ui::OwnedWidgetGtk dangerous_hbox_; |
| 210 int dangerous_hbox_start_width_; | 210 int dangerous_hbox_start_width_; |
| 211 int dangerous_hbox_full_width_; | 211 int dangerous_hbox_full_width_; |
| 212 | 212 |
| 213 // The animation when this item is first added to the shelf. | 213 // The animation when this item is first added to the shelf. |
| 214 scoped_ptr<ui::SlideAnimation> new_item_animation_; | 214 scoped_ptr<ui::SlideAnimation> new_item_animation_; |
| 215 | 215 |
| 216 // Progress animation. | 216 // Progress animation. |
| 217 base::RepeatingTimer<DownloadItemGtk> progress_timer_; | 217 base::RepeatingTimer<DownloadItemGtk> progress_timer_; |
| 218 | 218 |
| 219 // Animation for download complete. | 219 // Animation for download complete. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 235 | 235 |
| 236 // For canceling an in progress icon request. | 236 // For canceling an in progress icon request. |
| 237 CancelableRequestConsumerT<int, 0> icon_consumer_; | 237 CancelableRequestConsumerT<int, 0> icon_consumer_; |
| 238 | 238 |
| 239 // Indicates when the download has completed, so we don't redo | 239 // Indicates when the download has completed, so we don't redo |
| 240 // on-completion actions. | 240 // on-completion actions. |
| 241 bool download_complete_; | 241 bool download_complete_; |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_GTK_H_ | 244 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_ITEM_GTK_H_ |
| OLD | NEW |