OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk_theme_provider.h" | 5 #include "chrome/browser/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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 case IDR_THEME_FRAME_INCOGNITO: | 905 case IDR_THEME_FRAME_INCOGNITO: |
906 return GenerateFrameImage(BrowserThemeProvider::TINT_FRAME_INCOGNITO); | 906 return GenerateFrameImage(BrowserThemeProvider::TINT_FRAME_INCOGNITO); |
907 case IDR_THEME_FRAME_INCOGNITO_INACTIVE: { | 907 case IDR_THEME_FRAME_INCOGNITO_INACTIVE: { |
908 return GenerateFrameImage( | 908 return GenerateFrameImage( |
909 BrowserThemeProvider::TINT_FRAME_INCOGNITO_INACTIVE); | 909 BrowserThemeProvider::TINT_FRAME_INCOGNITO_INACTIVE); |
910 } | 910 } |
911 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and | 911 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and |
912 // instead should tint based on the foreground text entry color in GTK+ | 912 // instead should tint based on the foreground text entry color in GTK+ |
913 // mode because some themes that try to be dark *and* light have very | 913 // mode because some themes that try to be dark *and* light have very |
914 // different colors between the omnibox and the normal background area. | 914 // different colors between the omnibox and the normal background area. |
| 915 case IDR_OMNIBOX_HISTORY: |
| 916 case IDR_OMNIBOX_HTTP: |
| 917 case IDR_OMNIBOX_MORE: |
915 case IDR_OMNIBOX_SEARCH: | 918 case IDR_OMNIBOX_SEARCH: |
916 case IDR_OMNIBOX_MORE: | |
917 case IDR_OMNIBOX_STAR: | 919 case IDR_OMNIBOX_STAR: |
918 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: | 920 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: |
919 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: { | 921 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: { |
920 return GenerateTintedIcon(id, entry_tint_); | 922 return GenerateTintedIcon(id, entry_tint_); |
921 } | 923 } |
922 // Two sets of omnibox icons, the one for normal http and the one for | |
923 // history, include white backgrounds (and are supposed to, for the windows | |
924 // chrome-theme). On linux, where we have all sorts of wacky themes and | |
925 // color combinations we need to deal with, switch them out with | |
926 // transparent background versions. | |
927 case IDR_OMNIBOX_HTTP: { | |
928 return GenerateTintedIcon(IDR_OMNIBOX_HTTP_TRANSPARENT, entry_tint_); | |
929 } | |
930 case IDR_OMNIBOX_HISTORY: { | |
931 return GenerateTintedIcon(IDR_OMNIBOX_HISTORY_TRANSPARENT, entry_tint_); | |
932 } | |
933 // In GTK mode, the dark versions of the omnibox icons only ever appear in | 924 // In GTK mode, the dark versions of the omnibox icons only ever appear in |
934 // the autocomplete popup and only against the current theme's GtkEntry | 925 // the autocomplete popup and only against the current theme's GtkEntry |
935 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide | 926 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide |
936 // with the selected color. | 927 // with the selected color. |
937 case IDR_OMNIBOX_HTTP_DARK: { | 928 case IDR_OMNIBOX_HISTORY_DARK: |
938 return GenerateTintedIcon(IDR_OMNIBOX_HTTP_DARK_TRANSPARENT, | 929 case IDR_OMNIBOX_HTTP_DARK: |
939 selected_entry_tint_); | 930 case IDR_OMNIBOX_MORE_DARK: |
940 } | |
941 case IDR_OMNIBOX_HISTORY_DARK: { | |
942 return GenerateTintedIcon(IDR_OMNIBOX_HISTORY_DARK_TRANSPARENT, | |
943 selected_entry_tint_); | |
944 } | |
945 case IDR_OMNIBOX_SEARCH_DARK: | 931 case IDR_OMNIBOX_SEARCH_DARK: |
946 case IDR_OMNIBOX_MORE_DARK: | |
947 case IDR_OMNIBOX_STAR_DARK: { | 932 case IDR_OMNIBOX_STAR_DARK: { |
948 return GenerateTintedIcon(id, selected_entry_tint_); | 933 return GenerateTintedIcon(id, selected_entry_tint_); |
949 } | 934 } |
950 default: { | 935 default: { |
951 return GenerateTintedIcon(id, button_tint_); | 936 return GenerateTintedIcon(id, button_tint_); |
952 } | 937 } |
953 } | 938 } |
954 } | 939 } |
955 | 940 |
956 SkBitmap* GtkThemeProvider::GenerateFrameImage(int tint_id) const { | 941 SkBitmap* GtkThemeProvider::GenerateFrameImage(int tint_id) const { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 cairo_set_line_width(cr, 1.0); | 1040 cairo_set_line_width(cr, 1.0); |
1056 cairo_move_to(cr, start_x, widget->allocation.y); | 1041 cairo_move_to(cr, start_x, widget->allocation.y); |
1057 cairo_line_to(cr, start_x, | 1042 cairo_line_to(cr, start_x, |
1058 widget->allocation.y + widget->allocation.height); | 1043 widget->allocation.y + widget->allocation.height); |
1059 cairo_stroke(cr); | 1044 cairo_stroke(cr); |
1060 cairo_destroy(cr); | 1045 cairo_destroy(cr); |
1061 cairo_pattern_destroy(pattern); | 1046 cairo_pattern_destroy(pattern); |
1062 | 1047 |
1063 return TRUE; | 1048 return TRUE; |
1064 } | 1049 } |
OLD | NEW |