| 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 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h" | 5 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/download/download_item.h" | 9 #include "chrome/browser/download/download_item.h" |
| 10 #include "chrome/browser/download/download_item_model.h" | 10 #include "chrome/browser/download/download_item_model.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 GtkWidget* DownloadShelfGtk::GetHBox() const { | 279 GtkWidget* DownloadShelfGtk::GetHBox() const { |
| 280 return items_hbox_.get(); | 280 return items_hbox_.get(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void DownloadShelfGtk::MaybeShowMoreDownloadItems() { | 283 void DownloadShelfGtk::MaybeShowMoreDownloadItems() { |
| 284 // Show all existing download items. It'll trigger "size-allocate" signal, | 284 // Show all existing download items. It'll trigger "size-allocate" signal, |
| 285 // which will hide download items that don't have enough space to show. | 285 // which will hide download items that don't have enough space to show. |
| 286 gtk_widget_show_all(items_hbox_.get()); | 286 gtk_widget_show_all(items_hbox_.get()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void DownloadShelfGtk::CheckForFilesRemoval() { |
| 290 browser_->CheckForFilesRemoval(); |
| 291 } |
| 292 |
| 289 void DownloadShelfGtk::OnButtonClick(GtkWidget* button) { | 293 void DownloadShelfGtk::OnButtonClick(GtkWidget* button) { |
| 290 if (button == close_button_->widget()) { | 294 if (button == close_button_->widget()) { |
| 291 Close(); | 295 Close(); |
| 292 } else { | 296 } else { |
| 293 // The link button was clicked. | 297 // The link button was clicked. |
| 294 browser_->ShowDownloadsTab(); | 298 browser_->ShowDownloadsTab(); |
| 295 } | 299 } |
| 296 } | 300 } |
| 297 | 301 |
| 298 void DownloadShelfGtk::AutoCloseIfPossible() { | 302 void DownloadShelfGtk::AutoCloseIfPossible() { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 377 |
| 374 MessageLoop::current()->PostDelayedTask( | 378 MessageLoop::current()->PostDelayedTask( |
| 375 FROM_HERE, | 379 FROM_HERE, |
| 376 auto_close_factory_.NewRunnableMethod(&DownloadShelfGtk::Close), | 380 auto_close_factory_.NewRunnableMethod(&DownloadShelfGtk::Close), |
| 377 kAutoCloseDelayMs); | 381 kAutoCloseDelayMs); |
| 378 } | 382 } |
| 379 | 383 |
| 380 void DownloadShelfGtk::MouseEnteredShelf() { | 384 void DownloadShelfGtk::MouseEnteredShelf() { |
| 381 auto_close_factory_.RevokeAll(); | 385 auto_close_factory_.RevokeAll(); |
| 382 } | 386 } |
| OLD | NEW |