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_shelf_gtk.h" | 5 #include "chrome/browser/gtk/download_shelf_gtk.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/gfx/gtk_util.h" | 9 #include "base/gfx/gtk_util.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Create and pack the close button. | 90 // Create and pack the close button. |
91 close_button_.reset(CustomDrawButton::CloseButton(theme_provider_)); | 91 close_button_.reset(CustomDrawButton::CloseButton(theme_provider_)); |
92 gtk_util::CenterWidgetInHBox(hbox_.get(), close_button_->widget(), true, 0); | 92 gtk_util::CenterWidgetInHBox(hbox_.get(), close_button_->widget(), true, 0); |
93 g_signal_connect(close_button_->widget(), "clicked", | 93 g_signal_connect(close_button_->widget(), "clicked", |
94 G_CALLBACK(OnButtonClick), this); | 94 G_CALLBACK(OnButtonClick), this); |
95 | 95 |
96 // Create the "Show all downloads..." link and connect to the click event. | 96 // Create the "Show all downloads..." link and connect to the click event. |
97 std::string link_text = | 97 std::string link_text = |
98 l10n_util::GetStringUTF8(IDS_SHOW_ALL_DOWNLOADS); | 98 l10n_util::GetStringUTF8(IDS_SHOW_ALL_DOWNLOADS); |
99 GtkWidget* link_button = gtk_chrome_link_button_new(link_text.c_str()); | 99 GtkWidget* link_button = gtk_chrome_link_button_new(link_text.c_str()); |
100 gtk_chrome_link_button_set_use_gtk_theme( | |
101 GTK_CHROME_LINK_BUTTON(link_button), FALSE); | |
102 g_signal_connect(link_button, "clicked", | 100 g_signal_connect(link_button, "clicked", |
103 G_CALLBACK(OnButtonClick), this); | 101 G_CALLBACK(OnButtonClick), this); |
104 // Until we switch to vector graphics, force the font size. | 102 // Until we switch to vector graphics, force the font size. |
105 // 13.4px == 10pt @ 96dpi | 103 // 13.4px == 10pt @ 96dpi |
106 gtk_util::ForceFontSizePixels(GTK_CHROME_LINK_BUTTON(link_button)->label, | 104 gtk_util::ForceFontSizePixels(GTK_CHROME_LINK_BUTTON(link_button)->label, |
107 13.4); | 105 13.4); |
108 | 106 |
109 // Make the download arrow icon. | 107 // Make the download arrow icon. |
110 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 108 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
111 GdkPixbuf* download_pixbuf = rb.GetPixbufNamed(IDR_DOWNLOADS_FAVICON); | 109 GdkPixbuf* download_pixbuf = rb.GetPixbufNamed(IDR_DOWNLOADS_FAVICON); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // static | 209 // static |
212 void DownloadShelfGtk::OnButtonClick(GtkWidget* button, | 210 void DownloadShelfGtk::OnButtonClick(GtkWidget* button, |
213 DownloadShelfGtk* shelf) { | 211 DownloadShelfGtk* shelf) { |
214 if (button == shelf->close_button_->widget()) { | 212 if (button == shelf->close_button_->widget()) { |
215 shelf->Close(); | 213 shelf->Close(); |
216 } else { | 214 } else { |
217 // The link button was clicked. | 215 // The link button was clicked. |
218 shelf->browser_->ShowDownloadsTab(); | 216 shelf->browser_->ShowDownloadsTab(); |
219 } | 217 } |
220 } | 218 } |
OLD | NEW |