| 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/gtk_theme_service.h" | 5 #include "chrome/browser/ui/gtk/gtk_theme_service.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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 IDR_OMNIBOX_HTTP, | 105 IDR_OMNIBOX_HTTP, |
| 106 IDR_OMNIBOX_HTTP_DARK, | 106 IDR_OMNIBOX_HTTP_DARK, |
| 107 IDR_OMNIBOX_SEARCH, | 107 IDR_OMNIBOX_SEARCH, |
| 108 IDR_OMNIBOX_SEARCH_DARK, | 108 IDR_OMNIBOX_SEARCH_DARK, |
| 109 IDR_OMNIBOX_STAR, | 109 IDR_OMNIBOX_STAR, |
| 110 IDR_OMNIBOX_STAR_DARK, | 110 IDR_OMNIBOX_STAR_DARK, |
| 111 IDR_OMNIBOX_TTS, | 111 IDR_OMNIBOX_TTS, |
| 112 IDR_OMNIBOX_TTS_DARK, | 112 IDR_OMNIBOX_TTS_DARK, |
| 113 IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON, | 113 IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON, |
| 114 IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON, | 114 IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON, |
| 115 IDR_REGISTER_PROTOCOL_HANDLER_LOCATIONBAR_ICON, |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 bool IsOverridableImage(int id) { | 118 bool IsOverridableImage(int id) { |
| 118 CR_DEFINE_STATIC_LOCAL(std::set<int>, images, ()); | 119 CR_DEFINE_STATIC_LOCAL(std::set<int>, images, ()); |
| 119 if (images.empty()) { | 120 if (images.empty()) { |
| 120 images.insert(kThemeImages, kThemeImages + arraysize(kThemeImages)); | 121 images.insert(kThemeImages, kThemeImages + arraysize(kThemeImages)); |
| 121 images.insert(kAutocompleteImages, | 122 images.insert(kAutocompleteImages, |
| 122 kAutocompleteImages + arraysize(kAutocompleteImages)); | 123 kAutocompleteImages + arraysize(kAutocompleteImages)); |
| 123 | 124 |
| 124 const std::set<int>& buttons = ThemeService::GetTintableToolbarButtons(); | 125 const std::set<int>& buttons = ThemeService::GetTintableToolbarButtons(); |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and | 970 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and |
| 970 // instead should tint based on the foreground text entry color in GTK+ | 971 // instead should tint based on the foreground text entry color in GTK+ |
| 971 // mode because some themes that try to be dark *and* light have very | 972 // mode because some themes that try to be dark *and* light have very |
| 972 // different colors between the omnibox and the normal background area. | 973 // different colors between the omnibox and the normal background area. |
| 973 case IDR_OMNIBOX_EXTENSION_APP: | 974 case IDR_OMNIBOX_EXTENSION_APP: |
| 974 case IDR_OMNIBOX_HTTP: | 975 case IDR_OMNIBOX_HTTP: |
| 975 case IDR_OMNIBOX_SEARCH: | 976 case IDR_OMNIBOX_SEARCH: |
| 976 case IDR_OMNIBOX_STAR: | 977 case IDR_OMNIBOX_STAR: |
| 977 case IDR_OMNIBOX_TTS: | 978 case IDR_OMNIBOX_TTS: |
| 978 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: | 979 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: |
| 979 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: { | 980 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: |
| 981 case IDR_REGISTER_PROTOCOL_HANDLER_LOCATIONBAR_ICON: { |
| 980 return GenerateTintedIcon(id, entry_tint_); | 982 return GenerateTintedIcon(id, entry_tint_); |
| 981 } | 983 } |
| 982 // In GTK mode, the dark versions of the omnibox icons only ever appear in | 984 // In GTK mode, the dark versions of the omnibox icons only ever appear in |
| 983 // the autocomplete popup and only against the current theme's GtkEntry | 985 // the autocomplete popup and only against the current theme's GtkEntry |
| 984 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide | 986 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide |
| 985 // with the selected color. | 987 // with the selected color. |
| 986 case IDR_OMNIBOX_EXTENSION_APP_DARK: | 988 case IDR_OMNIBOX_EXTENSION_APP_DARK: |
| 987 case IDR_OMNIBOX_HTTP_DARK: | 989 case IDR_OMNIBOX_HTTP_DARK: |
| 988 case IDR_OMNIBOX_SEARCH_DARK: | 990 case IDR_OMNIBOX_SEARCH_DARK: |
| 989 case IDR_OMNIBOX_STAR_DARK: | 991 case IDR_OMNIBOX_STAR_DARK: |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 cairo_new_path(cr); | 1146 cairo_new_path(cr); |
| 1145 cairo_set_line_width(cr, 1.0); | 1147 cairo_set_line_width(cr, 1.0); |
| 1146 cairo_move_to(cr, start_x, allocation.y); | 1148 cairo_move_to(cr, start_x, allocation.y); |
| 1147 cairo_line_to(cr, start_x, allocation.y + allocation.height); | 1149 cairo_line_to(cr, start_x, allocation.y + allocation.height); |
| 1148 cairo_stroke(cr); | 1150 cairo_stroke(cr); |
| 1149 cairo_destroy(cr); | 1151 cairo_destroy(cr); |
| 1150 cairo_pattern_destroy(pattern); | 1152 cairo_pattern_destroy(pattern); |
| 1151 | 1153 |
| 1152 return TRUE; | 1154 return TRUE; |
| 1153 } | 1155 } |
| OLD | NEW |