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 "base/gfx/gtk_util.h" |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
8 #include "chrome/browser/download/download_item_model.h" | 9 #include "chrome/browser/download/download_item_model.h" |
9 #include "chrome/browser/gtk/custom_button.h" | 10 #include "chrome/browser/gtk/custom_button.h" |
10 #include "chrome/browser/gtk/download_item_gtk.h" | 11 #include "chrome/browser/gtk/download_item_gtk.h" |
11 #include "chrome/browser/tab_contents/tab_contents.h" | 12 #include "chrome/browser/tab_contents/tab_contents.h" |
12 #include "chrome/common/l10n_util.h" | 13 #include "chrome/common/l10n_util.h" |
13 #include "chrome/common/resource_bundle.h" | 14 #include "chrome/common/resource_bundle.h" |
14 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
15 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
16 | 17 |
(...skipping 10 matching lines...) Expand all Loading... |
27 // shelf. | 28 // shelf. |
28 const int kTopBottomPadding = 4; | 29 const int kTopBottomPadding = 4; |
29 | 30 |
30 // Padding between the left side of the shelf and the first download item. | 31 // Padding between the left side of the shelf and the first download item. |
31 const int kLeftPadding = 2; | 32 const int kLeftPadding = 2; |
32 | 33 |
33 // Padding between the right side of the shelf and the close button. | 34 // Padding between the right side of the shelf and the close button. |
34 const int kRightPadding = 10; | 35 const int kRightPadding = 10; |
35 | 36 |
36 // The background color of the shelf. | 37 // The background color of the shelf. |
37 static GdkColor kBackgroundColor = { 0, 230 * 257, 237 * 257, 244 * 257 }; | 38 static GdkColor kBackgroundColor = GDK_COLOR_RGB(230, 237, 244); |
38 | 39 |
39 // Border color (the top pixel of the shelf). | 40 // Border color (the top pixel of the shelf). |
40 static GdkColor kBorderColor = { 0, 214 * 257, 214 * 257, 214 * 257 }; | 41 static GdkColor kBorderColor = GDK_COLOR_RGB(214, 214, 214); |
41 | 42 |
42 const char* kLinkMarkup = | 43 const char* kLinkMarkup = |
43 "<u><span color=\"blue\">%s</span></u>"; | 44 "<u><span color=\"blue\">%s</span></u>"; |
44 | 45 |
45 gboolean OnLinkExpose(GtkWidget* widget, GdkEventExpose* e, void*) { | 46 gboolean OnLinkExpose(GtkWidget* widget, GdkEventExpose* e, void*) { |
46 // Draw the link inside the button. | 47 // Draw the link inside the button. |
47 gtk_container_propagate_expose(GTK_CONTAINER(widget), | 48 gtk_container_propagate_expose(GTK_CONTAINER(widget), |
48 gtk_bin_get_child(GTK_BIN(widget)), | 49 gtk_bin_get_child(GTK_BIN(widget)), |
49 e); | 50 e); |
50 // Don't let the button draw itself, ever. | 51 // Don't let the button draw itself, ever. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // static | 206 // static |
206 void DownloadShelfGtk::OnButtonClick(GtkWidget* button, | 207 void DownloadShelfGtk::OnButtonClick(GtkWidget* button, |
207 DownloadShelfGtk* shelf) { | 208 DownloadShelfGtk* shelf) { |
208 if (button == shelf->close_button_->widget()) { | 209 if (button == shelf->close_button_->widget()) { |
209 shelf->Hide(); | 210 shelf->Hide(); |
210 } else { | 211 } else { |
211 // The link button was clicked. | 212 // The link button was clicked. |
212 shelf->ShowAllDownloads(); | 213 shelf->ShowAllDownloads(); |
213 } | 214 } |
214 } | 215 } |
OLD | NEW |