| 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/gfx/chrome_canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/chrome_font.h" | 8 #include "app/gfx/font.h" |
| 9 #include "app/gfx/text_elider.h" | 9 #include "app/gfx/text_elider.h" |
| 10 #include "app/slide_animation.h" | 10 #include "app/slide_animation.h" |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "chrome/browser/download/download_item_model.h" | 14 #include "chrome/browser/download/download_item_model.h" |
| 15 #include "chrome/browser/download/download_manager.h" | 15 #include "chrome/browser/download/download_manager.h" |
| 16 #include "chrome/browser/download/download_shelf.h" | 16 #include "chrome/browser/download/download_shelf.h" |
| 17 #include "chrome/browser/download/download_util.h" | 17 #include "chrome/browser/download/download_util.h" |
| 18 #include "chrome/browser/gtk/download_shelf_gtk.h" | 18 #include "chrome/browser/gtk/download_shelf_gtk.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 if (child) | 395 if (child) |
| 396 gtk_container_propagate_expose(GTK_CONTAINER(widget), child, e); | 396 gtk_container_propagate_expose(GTK_CONTAINER(widget), child, e); |
| 397 | 397 |
| 398 return TRUE; | 398 return TRUE; |
| 399 } | 399 } |
| 400 | 400 |
| 401 // static | 401 // static |
| 402 gboolean DownloadItemGtk::OnProgressAreaExpose(GtkWidget* widget, | 402 gboolean DownloadItemGtk::OnProgressAreaExpose(GtkWidget* widget, |
| 403 GdkEventExpose* event, DownloadItemGtk* download_item) { | 403 GdkEventExpose* event, DownloadItemGtk* download_item) { |
| 404 // Create a transparent canvas. | 404 // Create a transparent canvas. |
| 405 ChromeCanvasPaint canvas(event, false); | 405 gfx::CanvasPaint canvas(event, false); |
| 406 if (download_item->complete_animation_.get()) { | 406 if (download_item->complete_animation_.get()) { |
| 407 if (download_item->complete_animation_->IsAnimating()) { | 407 if (download_item->complete_animation_->IsAnimating()) { |
| 408 download_util::PaintDownloadComplete(&canvas, | 408 download_util::PaintDownloadComplete(&canvas, |
| 409 widget->allocation.x, widget->allocation.y, | 409 widget->allocation.x, widget->allocation.y, |
| 410 download_item->complete_animation_->GetCurrentValue(), | 410 download_item->complete_animation_->GetCurrentValue(), |
| 411 download_util::SMALL); | 411 download_util::SMALL); |
| 412 } | 412 } |
| 413 } else { | 413 } else { |
| 414 download_util::PaintDownloadProgress(&canvas, | 414 download_util::PaintDownloadProgress(&canvas, |
| 415 widget->allocation.x, widget->allocation.y, | 415 widget->allocation.x, widget->allocation.y, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 // static | 453 // static |
| 454 void DownloadItemGtk::OnShelfResized(GtkWidget *widget, | 454 void DownloadItemGtk::OnShelfResized(GtkWidget *widget, |
| 455 GtkAllocation *allocation, | 455 GtkAllocation *allocation, |
| 456 DownloadItemGtk* item) { | 456 DownloadItemGtk* item) { |
| 457 if (item->hbox_->allocation.x + item->hbox_->allocation.width > | 457 if (item->hbox_->allocation.x + item->hbox_->allocation.width > |
| 458 item->bounding_widget_->allocation.x) | 458 item->bounding_widget_->allocation.x) |
| 459 gtk_widget_hide(item->hbox_); | 459 gtk_widget_hide(item->hbox_); |
| 460 else | 460 else |
| 461 gtk_widget_show(item->hbox_); | 461 gtk_widget_show(item->hbox_); |
| 462 } | 462 } |
| OLD | NEW |