| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/test/testing_profile.h" | 5 #include "chrome/test/testing_profile.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 10 #include "chrome/browser/history/history_backend.h" | 10 #include "chrome/browser/history/history_backend.h" |
| 11 #include "chrome/browser/sync/profile_sync_service.h" | 11 #include "chrome/browser/sync/profile_sync_service.h" |
| 12 #include "chrome/common/chrome_constants.h" | 12 #include "chrome/common/chrome_constants.h" |
| 13 #include "webkit/database/database_tracker.h" |
| 13 | 14 |
| 14 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 15 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
| 15 #include "chrome/browser/gtk/gtk_theme_provider.h" | 16 #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 16 #endif | 17 #endif |
| 17 | 18 |
| 18 using base::Time; | 19 using base::Time; |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 // Task used to make sure history has finished processing a request. Intended | 23 // Task used to make sure history has finished processing a request. Intended |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 void TestingProfile::CreateTemplateURLModel() { | 176 void TestingProfile::CreateTemplateURLModel() { |
| 176 template_url_model_.reset(new TemplateURLModel(this)); | 177 template_url_model_.reset(new TemplateURLModel(this)); |
| 177 } | 178 } |
| 178 | 179 |
| 179 void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) { | 180 void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) { |
| 180 theme_provider->Init(this); | 181 theme_provider->Init(this); |
| 181 created_theme_provider_ = true; | 182 created_theme_provider_ = true; |
| 182 theme_provider_.reset(theme_provider); | 183 theme_provider_.reset(theme_provider); |
| 183 } | 184 } |
| 184 | 185 |
| 186 webkit_database::DatabaseTracker* TestingProfile::GetDatabaseTracker() { |
| 187 if (!db_tracker_) |
| 188 db_tracker_ = new webkit_database::DatabaseTracker(GetPath()); |
| 189 return db_tracker_; |
| 190 } |
| 191 |
| 185 void TestingProfile::InitThemes() { | 192 void TestingProfile::InitThemes() { |
| 186 if (!created_theme_provider_) { | 193 if (!created_theme_provider_) { |
| 187 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 194 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
| 188 theme_provider_.reset(new GtkThemeProvider); | 195 theme_provider_.reset(new GtkThemeProvider); |
| 189 #else | 196 #else |
| 190 theme_provider_.reset(new BrowserThemeProvider); | 197 theme_provider_.reset(new BrowserThemeProvider); |
| 191 #endif | 198 #endif |
| 192 theme_provider_->Init(this); | 199 theme_provider_->Init(this); |
| 193 created_theme_provider_ = true; | 200 created_theme_provider_ = true; |
| 194 } | 201 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 206 void TestingProfile::CreateProfileSyncService() { | 213 void TestingProfile::CreateProfileSyncService() { |
| 207 if (!profile_sync_service_.get()) { | 214 if (!profile_sync_service_.get()) { |
| 208 profile_sync_service_.reset(new ProfileSyncService(this)); | 215 profile_sync_service_.reset(new ProfileSyncService(this)); |
| 209 profile_sync_service_->Initialize(); | 216 profile_sync_service_->Initialize(); |
| 210 } | 217 } |
| 211 } | 218 } |
| 212 | 219 |
| 213 ProfileSyncService* TestingProfile::GetProfileSyncService() { | 220 ProfileSyncService* TestingProfile::GetProfileSyncService() { |
| 214 return profile_sync_service_.get(); | 221 return profile_sync_service_.get(); |
| 215 } | 222 } |
| OLD | NEW |