| 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/libgtk2ui/gtk2_ui.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 IDR_OMNIBOX_HTTP, | 102 IDR_OMNIBOX_HTTP, |
| 103 IDR_OMNIBOX_HTTP_DARK, | 103 IDR_OMNIBOX_HTTP_DARK, |
| 104 IDR_OMNIBOX_SEARCH, | 104 IDR_OMNIBOX_SEARCH, |
| 105 IDR_OMNIBOX_SEARCH_DARK, | 105 IDR_OMNIBOX_SEARCH_DARK, |
| 106 IDR_OMNIBOX_STAR, | 106 IDR_OMNIBOX_STAR, |
| 107 IDR_OMNIBOX_STAR_DARK, | 107 IDR_OMNIBOX_STAR_DARK, |
| 108 IDR_OMNIBOX_TTS, | 108 IDR_OMNIBOX_TTS, |
| 109 IDR_OMNIBOX_TTS_DARK, | 109 IDR_OMNIBOX_TTS_DARK, |
| 110 IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON, | 110 IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON, |
| 111 IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON, | 111 IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON, |
| 112 IDR_REGISTER_PROTOCOL_HANDLER_LOCATIONBAR_ICON, |
| 112 }; | 113 }; |
| 113 | 114 |
| 114 // This table converts button ids into a pair of gtk-stock id and state. | 115 // This table converts button ids into a pair of gtk-stock id and state. |
| 115 struct IDRGtkMapping { | 116 struct IDRGtkMapping { |
| 116 int idr; | 117 int idr; |
| 117 const char* stock_id; | 118 const char* stock_id; |
| 118 GtkStateType gtk_state; | 119 GtkStateType gtk_state; |
| 119 } const kGtkIcons[] = { | 120 } const kGtkIcons[] = { |
| 120 { IDR_BACK, GTK_STOCK_GO_BACK, GTK_STATE_NORMAL }, | 121 { IDR_BACK, GTK_STOCK_GO_BACK, GTK_STATE_NORMAL }, |
| 121 { IDR_BACK_D, GTK_STOCK_GO_BACK, GTK_STATE_INSENSITIVE }, | 122 { IDR_BACK_D, GTK_STOCK_GO_BACK, GTK_STATE_INSENSITIVE }, |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and | 676 // Icons that sit inside the omnibox shouldn't receive TINT_BUTTONS and |
| 676 // instead should tint based on the foreground text entry color in GTK+ | 677 // instead should tint based on the foreground text entry color in GTK+ |
| 677 // mode because some themes that try to be dark *and* light have very | 678 // mode because some themes that try to be dark *and* light have very |
| 678 // different colors between the omnibox and the normal background area. | 679 // different colors between the omnibox and the normal background area. |
| 679 case IDR_OMNIBOX_EXTENSION_APP: | 680 case IDR_OMNIBOX_EXTENSION_APP: |
| 680 case IDR_OMNIBOX_HTTP: | 681 case IDR_OMNIBOX_HTTP: |
| 681 case IDR_OMNIBOX_SEARCH: | 682 case IDR_OMNIBOX_SEARCH: |
| 682 case IDR_OMNIBOX_STAR: | 683 case IDR_OMNIBOX_STAR: |
| 683 case IDR_OMNIBOX_TTS: | 684 case IDR_OMNIBOX_TTS: |
| 684 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: | 685 case IDR_GEOLOCATION_ALLOWED_LOCATIONBAR_ICON: |
| 685 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: { | 686 case IDR_GEOLOCATION_DENIED_LOCATIONBAR_ICON: |
| 687 case IDR_REGISTER_PROTOCOL_HANDLER_LOCATIONBAR_ICON: { |
| 686 return GenerateTintedIcon(id, entry_tint_); | 688 return GenerateTintedIcon(id, entry_tint_); |
| 687 } | 689 } |
| 688 // In GTK mode, the dark versions of the omnibox icons only ever appear in | 690 // In GTK mode, the dark versions of the omnibox icons only ever appear in |
| 689 // the autocomplete popup and only against the current theme's GtkEntry | 691 // the autocomplete popup and only against the current theme's GtkEntry |
| 690 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide | 692 // base[GTK_STATE_SELECTED] color, so tint the icons so they won't collide |
| 691 // with the selected color. | 693 // with the selected color. |
| 692 case IDR_OMNIBOX_EXTENSION_APP_DARK: | 694 case IDR_OMNIBOX_EXTENSION_APP_DARK: |
| 693 case IDR_OMNIBOX_HTTP_DARK: | 695 case IDR_OMNIBOX_HTTP_DARK: |
| 694 case IDR_OMNIBOX_SEARCH_DARK: | 696 case IDR_OMNIBOX_SEARCH_DARK: |
| 695 case IDR_OMNIBOX_STAR_DARK: | 697 case IDR_OMNIBOX_STAR_DARK: |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 | 952 |
| 951 void Gtk2UI::ClearAllThemeData() { | 953 void Gtk2UI::ClearAllThemeData() { |
| 952 STLDeleteValues(>k_images_); | 954 STLDeleteValues(>k_images_); |
| 953 } | 955 } |
| 954 | 956 |
| 955 } // namespace libgtk2ui | 957 } // namespace libgtk2ui |
| 956 | 958 |
| 957 ui::LinuxUI* BuildGtk2UI() { | 959 ui::LinuxUI* BuildGtk2UI() { |
| 958 return new libgtk2ui::Gtk2UI; | 960 return new libgtk2ui::Gtk2UI; |
| 959 } | 961 } |
| OLD | NEW |