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/gtk_theme_provider.h" | 5 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // A list of icons used in the autocomplete view that should be tinted to the | 98 // A list of icons used in the autocomplete view that should be tinted to the |
99 // current gtk theme selection color so they stand out against the GtkEntry's | 99 // current gtk theme selection color so they stand out against the GtkEntry's |
100 // base color. | 100 // base color. |
101 const int kAutocompleteImages[] = { | 101 const int kAutocompleteImages[] = { |
102 IDR_OMNIBOX_HTTP, | 102 IDR_OMNIBOX_HTTP, |
103 IDR_OMNIBOX_HTTP_DARK, | 103 IDR_OMNIBOX_HTTP_DARK, |
104 IDR_OMNIBOX_HISTORY, | 104 IDR_OMNIBOX_HISTORY, |
105 IDR_OMNIBOX_HISTORY_DARK, | 105 IDR_OMNIBOX_HISTORY_DARK, |
106 IDR_OMNIBOX_SEARCH, | 106 IDR_OMNIBOX_SEARCH, |
107 IDR_OMNIBOX_SEARCH_DARK, | 107 IDR_OMNIBOX_SEARCH_DARK, |
108 IDR_OMNIBOX_MORE, | |
109 IDR_OMNIBOX_MORE_DARK, | |
110 IDR_OMNIBOX_STAR, | 108 IDR_OMNIBOX_STAR, |
111 IDR_OMNIBOX_STAR_DARK, | 109 IDR_OMNIBOX_STAR_DARK, |
112 IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON, | 110 IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON, |
113 IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON | 111 IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON |
114 }; | 112 }; |
115 | 113 |
116 bool IsOverridableImage(int id) { | 114 bool IsOverridableImage(int id) { |
117 static std::set<int> images; | 115 static std::set<int> images; |
118 if (images.empty()) { | 116 if (images.empty()) { |
119 images.insert(kThemeImages, kThemeImages + arraysize(kThemeImages)); | 117 images.insert(kThemeImages, kThemeImages + arraysize(kThemeImages)); |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 return GenerateFrameImage( | 938 return GenerateFrameImage( |
941 BrowserThemeProvider::COLOR_FRAME_INCOGNITO_INACTIVE, | 939 BrowserThemeProvider::COLOR_FRAME_INCOGNITO_INACTIVE, |
942 "incognito-inactive-frame-gradient-color"); | 940 "incognito-inactive-frame-gradient-color"); |
943 } | 941 } |
944 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and | 942 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and |
945 // instead should tint based on the foreground text entry color in GTK+ | 943 // instead should tint based on the foreground text entry color in GTK+ |
946 // mode because some themes that try to be dark *and* light have very | 944 // mode because some themes that try to be dark *and* light have very |
947 // different colors between the omnibox and the normal background area. | 945 // different colors between the omnibox and the normal background area. |
948 case IDR_OMNIBOX_HISTORY: | 946 case IDR_OMNIBOX_HISTORY: |
949 case IDR_OMNIBOX_HTTP: | 947 case IDR_OMNIBOX_HTTP: |
950 case IDR_OMNIBOX_MORE: | |
951 case IDR_OMNIBOX_SEARCH: | 948 case IDR_OMNIBOX_SEARCH: |
952 case IDR_OMNIBOX_STAR: | 949 case IDR_OMNIBOX_STAR: |
953 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: | 950 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: |
954 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: { | 951 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: { |
955 return GenerateTintedIcon(id, entry_tint_); | 952 return GenerateTintedIcon(id, entry_tint_); |
956 } | 953 } |
957 // In GTK mode, the dark versions of the omnibox icons only ever appear in | 954 // In GTK mode, the dark versions of the omnibox icons only ever appear in |
958 // the autocomplete popup and only against the current theme's GtkEntry | 955 // the autocomplete popup and only against the current theme's GtkEntry |
959 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide | 956 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide |
960 // with the selected color. | 957 // with the selected color. |
961 case IDR_OMNIBOX_HISTORY_DARK: | 958 case IDR_OMNIBOX_HISTORY_DARK: |
962 case IDR_OMNIBOX_HTTP_DARK: | 959 case IDR_OMNIBOX_HTTP_DARK: |
963 case IDR_OMNIBOX_MORE_DARK: | |
964 case IDR_OMNIBOX_SEARCH_DARK: | 960 case IDR_OMNIBOX_SEARCH_DARK: |
965 case IDR_OMNIBOX_STAR_DARK: { | 961 case IDR_OMNIBOX_STAR_DARK: { |
966 return GenerateTintedIcon(id, selected_entry_tint_); | 962 return GenerateTintedIcon(id, selected_entry_tint_); |
967 } | 963 } |
968 default: { | 964 default: { |
969 return GenerateTintedIcon(id, button_tint_); | 965 return GenerateTintedIcon(id, button_tint_); |
970 } | 966 } |
971 } | 967 } |
972 } | 968 } |
973 | 969 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 cairo_set_line_width(cr, 1.0); | 1119 cairo_set_line_width(cr, 1.0); |
1124 cairo_move_to(cr, start_x, widget->allocation.y); | 1120 cairo_move_to(cr, start_x, widget->allocation.y); |
1125 cairo_line_to(cr, start_x, | 1121 cairo_line_to(cr, start_x, |
1126 widget->allocation.y + widget->allocation.height); | 1122 widget->allocation.y + widget->allocation.height); |
1127 cairo_stroke(cr); | 1123 cairo_stroke(cr); |
1128 cairo_destroy(cr); | 1124 cairo_destroy(cr); |
1129 cairo_pattern_destroy(pattern); | 1125 cairo_pattern_destroy(pattern); |
1130 | 1126 |
1131 return TRUE; | 1127 return TRUE; |
1132 } | 1128 } |
OLD | NEW |