diff options
-rw-r--r-- | chrome/browser/browser_theme_provider.h | 3 | ||||
-rw-r--r-- | chrome/browser/profile.cc | 11 | ||||
-rw-r--r-- | chrome/browser/profile.h | 2 | ||||
-rw-r--r-- | chrome/test/testing_profile.cc | 9 | ||||
-rw-r--r-- | chrome/test/testing_profile.h | 2 |
5 files changed, 11 insertions, 16 deletions
diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h index 0d11a6a..3c72549e 100644 --- a/chrome/browser/browser_theme_provider.h +++ b/chrome/browser/browser_theme_provider.h @@ -20,8 +20,7 @@ class Extension; class Profile; class DictionaryValue; -class BrowserThemeProvider : public base::RefCounted<BrowserThemeProvider>, - public NonThreadSafe, +class BrowserThemeProvider : public NonThreadSafe, public ThemeProvider { public: // Public constants used in BrowserThemeProvider and its subclasses: diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 8655eae..208bd0c 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -536,8 +536,6 @@ class OffTheRecordProfileImpl : public Profile, // The download manager that only stores downloaded items in memory. scoped_refptr<DownloadManager> download_manager_; - scoped_refptr<BrowserThemeProvider> theme_provider_; - // Use a special WebKit context for OTR browsing. scoped_refptr<WebKitContext> webkit_context_; @@ -725,7 +723,7 @@ ProfileImpl::~ProfileImpl() { download_manager_ = NULL; // The theme provider provides bitmaps to whoever wants them. - theme_provider_ = NULL; + theme_provider_.reset(); // The ThumbnailStore saves thumbnails used by the NTP. Call Shutdown to // save any new thumbnails to disk and release its reference to the @@ -1112,13 +1110,12 @@ bool ProfileImpl::HasCreatedDownloadManager() const { void ProfileImpl::InitThemes() { if (!created_theme_provider_) { #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) - scoped_refptr<BrowserThemeProvider> themes(new GtkThemeProvider); + theme_provider_.reset(new GtkThemeProvider); #else - scoped_refptr<BrowserThemeProvider> themes(new BrowserThemeProvider); + theme_provider_.reset(new BrowserThemeProvider); #endif - themes->Init(this); + theme_provider_->Init(this); created_theme_provider_ = true; - theme_provider_.swap(themes); } } diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 6d6cfc8..a4f887c 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -502,7 +502,7 @@ class ProfileImpl : public Profile, scoped_refptr<WebDataService> web_data_service_; scoped_refptr<PasswordStore> password_store_; scoped_refptr<SessionService> session_service_; - scoped_refptr<BrowserThemeProvider> theme_provider_; + scoped_ptr<BrowserThemeProvider> theme_provider_; scoped_refptr<WebKitContext> webkit_context_; bool history_service_created_; bool favicon_service_created_; diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index bddfc7f..2f417cf 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -175,19 +175,18 @@ void TestingProfile::CreateTemplateURLModel() { void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) { theme_provider->Init(this); created_theme_provider_ = true; - theme_provider_ = theme_provider; + theme_provider_.reset(theme_provider); } void TestingProfile::InitThemes() { if (!created_theme_provider_) { #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) - scoped_refptr<BrowserThemeProvider> themes(new GtkThemeProvider); + theme_provider_.reset(new GtkThemeProvider); #else - scoped_refptr<BrowserThemeProvider> themes(new BrowserThemeProvider); + theme_provider_.reset(new BrowserThemeProvider); #endif - themes->Init(this); + theme_provider_->Init(this); created_theme_provider_ = true; - theme_provider_.swap(themes); } } diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index b61e88d..b894d7b 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -270,7 +270,7 @@ class TestingProfile : public Profile { scoped_refptr<SessionService> session_service_; // The theme provider. Created lazily by GetThemeProvider()/InitThemes(). - scoped_refptr<BrowserThemeProvider> theme_provider_; + scoped_ptr<BrowserThemeProvider> theme_provider_; bool created_theme_provider_; // Do we have a history service? This defaults to the value of |