Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Side by Side Diff: chrome/browser/themes/browser_theme_provider.cc

Issue 4957005: Move themes garbage-collection out of shutdown code. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressed asargent's comments Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/browser_theme_provider.h ('k') | chrome/test/live_sync/single_client_live_themes_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698