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 "base/gfx/png_decoder.h" | 7 #include "base/gfx/png_decoder.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // A map for kToolbarButtonIDs. | 118 // A map for kToolbarButtonIDs. |
119 static std::map<const int, bool> button_images_; | 119 static std::map<const int, bool> button_images_; |
120 | 120 |
121 // A map of frame image IDs to the tints for those ids. | 121 // A map of frame image IDs to the tints for those ids. |
122 static std::map<const int, int> frame_tints_; | 122 static std::map<const int, int> frame_tints_; |
123 | 123 |
124 BrowserThemeProvider::BrowserThemeProvider() | 124 BrowserThemeProvider::BrowserThemeProvider() |
125 : rb_(ResourceBundle::GetSharedInstance()) { | 125 : rb_(ResourceBundle::GetSharedInstance()) { |
126 static bool initialized = false; | 126 static bool initialized = false; |
127 if (!initialized) { | 127 if (!initialized) { |
128 for (size_t i = 0; i < sizeof(kToolbarButtonIDs); ++i) { | 128 for (size_t i = 0; i < arraysize(kToolbarButtonIDs); ++i) { |
129 button_images_[kToolbarButtonIDs[i]] = true; | 129 button_images_[kToolbarButtonIDs[i]] = true; |
130 } | 130 } |
131 frame_tints_[IDR_THEME_FRAME] = TINT_FRAME; | 131 frame_tints_[IDR_THEME_FRAME] = TINT_FRAME; |
132 frame_tints_[IDR_THEME_FRAME_INACTIVE] = TINT_FRAME_INACTIVE; | 132 frame_tints_[IDR_THEME_FRAME_INACTIVE] = TINT_FRAME_INACTIVE; |
133 frame_tints_[IDR_THEME_FRAME_INCOGNITO] = TINT_FRAME_INCOGNITO; | 133 frame_tints_[IDR_THEME_FRAME_INCOGNITO] = TINT_FRAME_INCOGNITO; |
134 frame_tints_[IDR_THEME_FRAME_INCOGNITO_INACTIVE] = | 134 frame_tints_[IDR_THEME_FRAME_INCOGNITO_INACTIVE] = |
135 TINT_FRAME_INCOGNITO_INACTIVE; | 135 TINT_FRAME_INCOGNITO_INACTIVE; |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 delete i->second; | 756 delete i->second; |
757 } | 757 } |
758 image_cache_.clear(); | 758 image_cache_.clear(); |
759 } | 759 } |
760 | 760 |
761 #if defined(OS_WIN) | 761 #if defined(OS_WIN) |
762 void BrowserThemeProvider::FreePlatformCaches() { | 762 void BrowserThemeProvider::FreePlatformCaches() { |
763 // Windows has no platform image cache to clear. | 763 // Windows has no platform image cache to clear. |
764 } | 764 } |
765 #endif | 765 #endif |
OLD | NEW |