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/theme_service_gtk.h" | 5 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 const int kAutocompleteImages[] = { | 102 const int kAutocompleteImages[] = { |
103 IDR_OMNIBOX_EXTENSION_APP, | 103 IDR_OMNIBOX_EXTENSION_APP, |
104 IDR_OMNIBOX_HTTP, | 104 IDR_OMNIBOX_HTTP, |
105 IDR_OMNIBOX_HTTP_DARK, | 105 IDR_OMNIBOX_HTTP_DARK, |
106 IDR_OMNIBOX_HISTORY, | 106 IDR_OMNIBOX_HISTORY, |
107 IDR_OMNIBOX_HISTORY_DARK, | 107 IDR_OMNIBOX_HISTORY_DARK, |
108 IDR_OMNIBOX_SEARCH, | 108 IDR_OMNIBOX_SEARCH, |
109 IDR_OMNIBOX_SEARCH_DARK, | 109 IDR_OMNIBOX_SEARCH_DARK, |
110 IDR_OMNIBOX_STAR, | 110 IDR_OMNIBOX_STAR, |
111 IDR_OMNIBOX_STAR_DARK, | 111 IDR_OMNIBOX_STAR_DARK, |
| 112 IDR_OMNIBOX_TTS, |
| 113 IDR_OMNIBOX_TTS_DARK, |
112 IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON, | 114 IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON, |
113 IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON, | 115 IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON, |
114 }; | 116 }; |
115 | 117 |
116 bool IsOverridableImage(int id) { | 118 bool IsOverridableImage(int id) { |
117 CR_DEFINE_STATIC_LOCAL(std::set<int>, images, ()); | 119 CR_DEFINE_STATIC_LOCAL(std::set<int>, images, ()); |
118 if (images.empty()) { | 120 if (images.empty()) { |
119 images.insert(kThemeImages, kThemeImages + arraysize(kThemeImages)); | 121 images.insert(kThemeImages, kThemeImages + arraysize(kThemeImages)); |
120 images.insert(kAutocompleteImages, | 122 images.insert(kAutocompleteImages, |
121 kAutocompleteImages + arraysize(kAutocompleteImages)); | 123 kAutocompleteImages + arraysize(kAutocompleteImages)); |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 } | 960 } |
959 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and | 961 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and |
960 // instead should tint based on the foreground text entry color in GTK+ | 962 // instead should tint based on the foreground text entry color in GTK+ |
961 // mode because some themes that try to be dark *and* light have very | 963 // mode because some themes that try to be dark *and* light have very |
962 // different colors between the omnibox and the normal background area. | 964 // different colors between the omnibox and the normal background area. |
963 case IDR_OMNIBOX_EXTENSION_APP: | 965 case IDR_OMNIBOX_EXTENSION_APP: |
964 case IDR_OMNIBOX_HISTORY: | 966 case IDR_OMNIBOX_HISTORY: |
965 case IDR_OMNIBOX_HTTP: | 967 case IDR_OMNIBOX_HTTP: |
966 case IDR_OMNIBOX_SEARCH: | 968 case IDR_OMNIBOX_SEARCH: |
967 case IDR_OMNIBOX_STAR: | 969 case IDR_OMNIBOX_STAR: |
| 970 case IDR_OMNIBOX_TTS: |
968 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: | 971 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: |
969 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: { | 972 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: { |
970 return GenerateTintedIcon(id, entry_tint_); | 973 return GenerateTintedIcon(id, entry_tint_); |
971 } | 974 } |
972 // In GTK mode, the dark versions of the omnibox icons only ever appear in | 975 // In GTK mode, the dark versions of the omnibox icons only ever appear in |
973 // the autocomplete popup and only against the current theme's GtkEntry | 976 // the autocomplete popup and only against the current theme's GtkEntry |
974 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide | 977 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide |
975 // with the selected color. | 978 // with the selected color. |
976 case IDR_OMNIBOX_EXTENSION_APP_DARK: | 979 case IDR_OMNIBOX_EXTENSION_APP_DARK: |
977 case IDR_OMNIBOX_HISTORY_DARK: | 980 case IDR_OMNIBOX_HISTORY_DARK: |
978 case IDR_OMNIBOX_HTTP_DARK: | 981 case IDR_OMNIBOX_HTTP_DARK: |
979 case IDR_OMNIBOX_SEARCH_DARK: | 982 case IDR_OMNIBOX_SEARCH_DARK: |
980 case IDR_OMNIBOX_STAR_DARK: { | 983 case IDR_OMNIBOX_STAR_DARK: |
| 984 case IDR_OMNIBOX_TTS_DARK: { |
981 return GenerateTintedIcon(id, selected_entry_tint_); | 985 return GenerateTintedIcon(id, selected_entry_tint_); |
982 } | 986 } |
983 default: { | 987 default: { |
984 return GenerateTintedIcon(id, button_tint_); | 988 return GenerateTintedIcon(id, button_tint_); |
985 } | 989 } |
986 } | 990 } |
987 } | 991 } |
988 | 992 |
989 SkBitmap* ThemeServiceGtk::GenerateFrameImage( | 993 SkBitmap* ThemeServiceGtk::GenerateFrameImage( |
990 int color_id, | 994 int color_id, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 cairo_new_path(cr); | 1137 cairo_new_path(cr); |
1134 cairo_set_line_width(cr, 1.0); | 1138 cairo_set_line_width(cr, 1.0); |
1135 cairo_move_to(cr, start_x, allocation.y); | 1139 cairo_move_to(cr, start_x, allocation.y); |
1136 cairo_line_to(cr, start_x, allocation.y + allocation.height); | 1140 cairo_line_to(cr, start_x, allocation.y + allocation.height); |
1137 cairo_stroke(cr); | 1141 cairo_stroke(cr); |
1138 cairo_destroy(cr); | 1142 cairo_destroy(cr); |
1139 cairo_pattern_destroy(pattern); | 1143 cairo_pattern_destroy(pattern); |
1140 | 1144 |
1141 return TRUE; | 1145 return TRUE; |
1142 } | 1146 } |
OLD | NEW |