| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/browser/download/download_item_model.h" | 10 #include "chrome/browser/download/download_item_model.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 g_signal_connect(link_button_, "clicked", | 128 g_signal_connect(link_button_, "clicked", |
| 129 G_CALLBACK(OnButtonClickThunk), this); | 129 G_CALLBACK(OnButtonClickThunk), this); |
| 130 gtk_util::SetButtonTriggersNavigation(link_button_); | 130 gtk_util::SetButtonTriggersNavigation(link_button_); |
| 131 // Until we switch to vector graphics, force the font size. | 131 // Until we switch to vector graphics, force the font size. |
| 132 // 13.4px == 10pt @ 96dpi | 132 // 13.4px == 10pt @ 96dpi |
| 133 gtk_util::ForceFontSizePixels(GTK_CHROME_LINK_BUTTON(link_button_)->label, | 133 gtk_util::ForceFontSizePixels(GTK_CHROME_LINK_BUTTON(link_button_)->label, |
| 134 13.4); | 134 13.4); |
| 135 | 135 |
| 136 // Make the download arrow icon. | 136 // Make the download arrow icon. |
| 137 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 137 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 138 GdkPixbuf* download_pixbuf = rb.GetNativeImageNamed(IDR_DOWNLOADS_FAVICON); | 138 GtkWidget* download_image = gtk_image_new_from_pixbuf( |
| 139 GtkWidget* download_image = gtk_image_new_from_pixbuf(download_pixbuf); | 139 rb.GetNativeImageNamed(IDR_DOWNLOADS_FAVICON).ToGdkPixbuf()); |
| 140 | 140 |
| 141 // Pack the link and the icon in outer hbox. | 141 // Pack the link and the icon in outer hbox. |
| 142 gtk_util::CenterWidgetInHBox(outer_hbox, link_button_, true, 0); | 142 gtk_util::CenterWidgetInHBox(outer_hbox, link_button_, true, 0); |
| 143 gtk_util::CenterWidgetInHBox(outer_hbox, download_image, true, 0); | 143 gtk_util::CenterWidgetInHBox(outer_hbox, download_image, true, 0); |
| 144 | 144 |
| 145 slide_widget_.reset(new SlideAnimatorGtk(shelf_.get(), | 145 slide_widget_.reset(new SlideAnimatorGtk(shelf_.get(), |
| 146 SlideAnimatorGtk::UP, | 146 SlideAnimatorGtk::UP, |
| 147 kShelfAnimationDurationMs, | 147 kShelfAnimationDurationMs, |
| 148 false, true, this)); | 148 false, true, this)); |
| 149 | 149 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 387 |
| 388 MessageLoop::current()->PostDelayedTask( | 388 MessageLoop::current()->PostDelayedTask( |
| 389 FROM_HERE, | 389 FROM_HERE, |
| 390 base::Bind(&DownloadShelfGtk::Close, weak_factory_.GetWeakPtr()), | 390 base::Bind(&DownloadShelfGtk::Close, weak_factory_.GetWeakPtr()), |
| 391 base::TimeDelta::FromMilliseconds(kAutoCloseDelayMs)); | 391 base::TimeDelta::FromMilliseconds(kAutoCloseDelayMs)); |
| 392 } | 392 } |
| 393 | 393 |
| 394 void DownloadShelfGtk::MouseEnteredShelf() { | 394 void DownloadShelfGtk::MouseEnteredShelf() { |
| 395 weak_factory_.InvalidateWeakPtrs(); | 395 weak_factory_.InvalidateWeakPtrs(); |
| 396 } | 396 } |
| OLD | NEW |