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/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // | 113 // |
114 // Default tints. | 114 // Default tints. |
115 const color_utils::HSL kDefaultTintButtons = { -1, -1, -1 }; | 115 const color_utils::HSL kDefaultTintButtons = { -1, -1, -1 }; |
116 const color_utils::HSL kDefaultTintFrame = { -1, -1, -1 }; | 116 const color_utils::HSL kDefaultTintFrame = { -1, -1, -1 }; |
117 const color_utils::HSL kDefaultTintFrameInactive = { -1, -1, 0.75f }; | 117 const color_utils::HSL kDefaultTintFrameInactive = { -1, -1, 0.75f }; |
118 const color_utils::HSL kDefaultTintFrameIncognito = { -1, 0.2f, 0.35f }; | 118 const color_utils::HSL kDefaultTintFrameIncognito = { -1, 0.2f, 0.35f }; |
119 const color_utils::HSL kDefaultTintFrameIncognitoInactive = { -1, 0.3f, 0.6f }; | 119 const color_utils::HSL kDefaultTintFrameIncognitoInactive = { -1, 0.3f, 0.6f }; |
120 const color_utils::HSL kDefaultTintBackgroundTab = { -1, 0.5, 0.75 }; | 120 const color_utils::HSL kDefaultTintBackgroundTab = { -1, 0.5, 0.75 }; |
121 | 121 |
122 // A list of images that we provide while in gtk mode. | 122 // A list of images that we provide while in gtk mode. |
| 123 // |
| 124 // TODO(erg): We list both the normal and *_DESKTOP versions of some of these |
| 125 // images because in some contexts, we don't go through the |
| 126 // chrome::MapThemeImage interface. That should be fixed, but tracking that |
| 127 // down is Hard. |
123 const int kThemeImages[] = { | 128 const int kThemeImages[] = { |
124 IDR_THEME_TOOLBAR, | 129 IDR_THEME_TOOLBAR, |
125 IDR_THEME_TAB_BACKGROUND, | 130 IDR_THEME_TAB_BACKGROUND, |
| 131 IDR_THEME_TAB_BACKGROUND_DESKTOP, |
126 IDR_THEME_TAB_BACKGROUND_INCOGNITO, | 132 IDR_THEME_TAB_BACKGROUND_INCOGNITO, |
| 133 IDR_THEME_TAB_BACKGROUND_INCOGNITO_DESKTOP, |
127 IDR_FRAME, | 134 IDR_FRAME, |
128 IDR_FRAME_INACTIVE, | 135 IDR_FRAME_INACTIVE, |
129 IDR_THEME_FRAME, | 136 IDR_THEME_FRAME, |
130 IDR_THEME_FRAME_INACTIVE, | 137 IDR_THEME_FRAME_INACTIVE, |
131 IDR_THEME_FRAME_INCOGNITO, | 138 IDR_THEME_FRAME_INCOGNITO, |
132 IDR_THEME_FRAME_INCOGNITO_INACTIVE, | 139 IDR_THEME_FRAME_INCOGNITO_INACTIVE, |
133 }; | 140 }; |
134 | 141 |
135 // A list of icons used in the autocomplete view that should be tinted to the | 142 // A list of icons used in the autocomplete view that should be tinted to the |
136 // current gtk theme selection color so they stand out against the GtkEntry's | 143 // current gtk theme selection color so they stand out against the GtkEntry's |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 GdkColor* color = &style->bg[GTK_STATE_NORMAL]; | 1040 GdkColor* color = &style->bg[GTK_STATE_NORMAL]; |
1034 SkBitmap bitmap; | 1041 SkBitmap bitmap; |
1035 bitmap.setConfig(SkBitmap::kARGB_8888_Config, | 1042 bitmap.setConfig(SkBitmap::kARGB_8888_Config, |
1036 kToolbarImageWidth, kToolbarImageHeight); | 1043 kToolbarImageWidth, kToolbarImageHeight); |
1037 bitmap.allocPixels(); | 1044 bitmap.allocPixels(); |
1038 bitmap.eraseARGB(0xff, color->red >> 8, color->green >> 8, | 1045 bitmap.eraseARGB(0xff, color->red >> 8, color->green >> 8, |
1039 color->blue >> 8); | 1046 color->blue >> 8); |
1040 return bitmap; | 1047 return bitmap; |
1041 } | 1048 } |
1042 case IDR_THEME_TAB_BACKGROUND: | 1049 case IDR_THEME_TAB_BACKGROUND: |
| 1050 case IDR_THEME_TAB_BACKGROUND_DESKTOP: |
1043 return GenerateTabImage(IDR_THEME_FRAME); | 1051 return GenerateTabImage(IDR_THEME_FRAME); |
1044 case IDR_THEME_TAB_BACKGROUND_INCOGNITO: | 1052 case IDR_THEME_TAB_BACKGROUND_INCOGNITO: |
| 1053 case IDR_THEME_TAB_BACKGROUND_INCOGNITO_DESKTOP: |
1045 return GenerateTabImage(IDR_THEME_FRAME_INCOGNITO); | 1054 return GenerateTabImage(IDR_THEME_FRAME_INCOGNITO); |
1046 case IDR_FRAME: | 1055 case IDR_FRAME: |
1047 case IDR_THEME_FRAME: | 1056 case IDR_THEME_FRAME: |
1048 return GenerateFrameImage(ThemeProperties::COLOR_FRAME, | 1057 return GenerateFrameImage(ThemeProperties::COLOR_FRAME, |
1049 "frame-gradient-color"); | 1058 "frame-gradient-color"); |
1050 case IDR_FRAME_INACTIVE: | 1059 case IDR_FRAME_INACTIVE: |
1051 case IDR_THEME_FRAME_INACTIVE: | 1060 case IDR_THEME_FRAME_INACTIVE: |
1052 return GenerateFrameImage(ThemeProperties::COLOR_FRAME_INACTIVE, | 1061 return GenerateFrameImage(ThemeProperties::COLOR_FRAME_INACTIVE, |
1053 "inactive-frame-gradient-color"); | 1062 "inactive-frame-gradient-color"); |
1054 case IDR_THEME_FRAME_INCOGNITO: | 1063 case IDR_THEME_FRAME_INCOGNITO: |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 ClearAllThemeData(); | 1392 ClearAllThemeData(); |
1384 LoadGtkValues(); | 1393 LoadGtkValues(); |
1385 NativeThemeGtk2::instance()->NotifyObservers(); | 1394 NativeThemeGtk2::instance()->NotifyObservers(); |
1386 } | 1395 } |
1387 | 1396 |
1388 } // namespace libgtk2ui | 1397 } // namespace libgtk2ui |
1389 | 1398 |
1390 views::LinuxUI* BuildGtk2UI() { | 1399 views::LinuxUI* BuildGtk2UI() { |
1391 return new libgtk2ui::Gtk2UI; | 1400 return new libgtk2ui::Gtk2UI; |
1392 } | 1401 } |
OLD | NEW |