OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser_theme_provider.h" | 5 #include "chrome/browser/browser_theme_provider.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 static std::set<int> themeable_images; | 148 static std::set<int> themeable_images; |
149 if (themeable_images.empty()) { | 149 if (themeable_images.empty()) { |
150 themeable_images.insert( | 150 themeable_images.insert( |
151 kThemeableImages, kThemeableImages + arraysize(kThemeableImages)); | 151 kThemeableImages, kThemeableImages + arraysize(kThemeableImages)); |
152 } | 152 } |
153 return themeable_images.count(themeable_image_id) > 0; | 153 return themeable_images.count(themeable_image_id) > 0; |
154 } | 154 } |
155 | 155 |
156 // The image resources that will be tinted by the 'button' tint value. | 156 // The image resources that will be tinted by the 'button' tint value. |
157 // If you change this list, you must increment the version number in | 157 // If you change this list, you must increment the version number in |
158 // browser_theme_pack.cc. | 158 // browser_theme_pack.cc and you should assign persistant ids to the |
| 159 // data table at the start of said file or otherwise tinted versions of |
| 160 // these resources will not be created. |
159 const int kToolbarButtonIDs[] = { | 161 const int kToolbarButtonIDs[] = { |
160 IDR_BACK, IDR_BACK_D, IDR_BACK_H, IDR_BACK_P, | 162 IDR_BACK, IDR_BACK_D, IDR_BACK_H, IDR_BACK_P, |
161 IDR_FORWARD, IDR_FORWARD_D, IDR_FORWARD_H, IDR_FORWARD_P, | 163 IDR_FORWARD, IDR_FORWARD_D, IDR_FORWARD_H, IDR_FORWARD_P, |
162 IDR_RELOAD, IDR_RELOAD_NOBORDER, IDR_RELOAD_NOBORDER_CENTER, IDR_RELOAD_H, | 164 IDR_RELOAD, IDR_RELOAD_NOBORDER, IDR_RELOAD_NOBORDER_CENTER, IDR_RELOAD_H, |
163 IDR_RELOAD_P, IDR_RELOAD_ENDCAP, IDR_RELOAD_ENDCAP_H, IDR_RELOAD_ENDCAP_P, | 165 IDR_RELOAD_P, IDR_RELOAD_ENDCAP, IDR_RELOAD_ENDCAP_H, IDR_RELOAD_ENDCAP_P, |
164 IDR_HOME, IDR_HOME_H, IDR_HOME_P, | 166 IDR_HOME, IDR_HOME_H, IDR_HOME_P, |
165 IDR_STAR, IDR_STAR_NOBORDER, IDR_STAR_NOBORDER_CENTER, IDR_STAR_D, IDR_STAR_H, | 167 IDR_STAR, IDR_STAR_NOBORDER, IDR_STAR_NOBORDER_CENTER, IDR_STAR_D, IDR_STAR_H, |
166 IDR_STAR_P, | 168 IDR_STAR_P, |
167 IDR_STARRED, IDR_STARRED_NOBORDER, IDR_STARRED_NOBORDER_CENTER, IDR_STARRED_H, | 169 IDR_STARRED, IDR_STARRED_NOBORDER, IDR_STARRED_NOBORDER_CENTER, IDR_STARRED_H, |
168 IDR_STARRED_P, | 170 IDR_STARRED_P, |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 void BrowserThemeProvider::OnInfobarDisplayed() { | 618 void BrowserThemeProvider::OnInfobarDisplayed() { |
617 number_of_infobars_++; | 619 number_of_infobars_++; |
618 } | 620 } |
619 | 621 |
620 void BrowserThemeProvider::OnInfobarDestroyed() { | 622 void BrowserThemeProvider::OnInfobarDestroyed() { |
621 number_of_infobars_--; | 623 number_of_infobars_--; |
622 | 624 |
623 if (number_of_infobars_ == 0) | 625 if (number_of_infobars_ == 0) |
624 RemoveUnusedThemes(); | 626 RemoveUnusedThemes(); |
625 } | 627 } |
OLD | NEW |