| 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/themes/browser_theme_provider.h" | 5 #include "chrome/browser/themes/browser_theme_provider.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/string_split.h" | 8 #include "base/string_split.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 BrowserThemeProvider::BrowserThemeProvider() | 189 BrowserThemeProvider::BrowserThemeProvider() |
| 190 : rb_(ResourceBundle::GetSharedInstance()), | 190 : rb_(ResourceBundle::GetSharedInstance()), |
| 191 profile_(NULL), | 191 profile_(NULL), |
| 192 number_of_infobars_(0) { | 192 number_of_infobars_(0) { |
| 193 // Initialize the themeable image map so we can use it on other threads. | 193 // Initialize the themeable image map so we can use it on other threads. |
| 194 HasThemeableImage(0); | 194 HasThemeableImage(0); |
| 195 } | 195 } |
| 196 | 196 |
| 197 BrowserThemeProvider::~BrowserThemeProvider() { | 197 BrowserThemeProvider::~BrowserThemeProvider() { |
| 198 FreePlatformCaches(); | 198 FreePlatformCaches(); |
| 199 | |
| 200 RemoveUnusedThemes(); | |
| 201 } | 199 } |
| 202 | 200 |
| 203 void BrowserThemeProvider::Init(Profile* profile) { | 201 void BrowserThemeProvider::Init(Profile* profile) { |
| 204 DCHECK(CalledOnValidThread()); | 202 DCHECK(CalledOnValidThread()); |
| 205 profile_ = profile; | 203 profile_ = profile; |
| 206 | 204 |
| 207 LoadThemePrefs(); | 205 LoadThemePrefs(); |
| 208 } | 206 } |
| 209 | 207 |
| 210 SkBitmap* BrowserThemeProvider::GetBitmapNamed(int id) const { | 208 SkBitmap* BrowserThemeProvider::GetBitmapNamed(int id) const { |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 void BrowserThemeProvider::OnInfobarDisplayed() { | 622 void BrowserThemeProvider::OnInfobarDisplayed() { |
| 625 number_of_infobars_++; | 623 number_of_infobars_++; |
| 626 } | 624 } |
| 627 | 625 |
| 628 void BrowserThemeProvider::OnInfobarDestroyed() { | 626 void BrowserThemeProvider::OnInfobarDestroyed() { |
| 629 number_of_infobars_--; | 627 number_of_infobars_--; |
| 630 | 628 |
| 631 if (number_of_infobars_ == 0) | 629 if (number_of_infobars_ == 0) |
| 632 RemoveUnusedThemes(); | 630 RemoveUnusedThemes(); |
| 633 } | 631 } |
| OLD | NEW |