| 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" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 DCHECK(bookmark_bar_model_->IsLoaded()); | 168 DCHECK(bookmark_bar_model_->IsLoaded()); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void TestingProfile::CreateTemplateURLModel() { | 171 void TestingProfile::CreateTemplateURLModel() { |
| 172 template_url_model_.reset(new TemplateURLModel(this)); | 172 template_url_model_.reset(new TemplateURLModel(this)); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) { | 175 void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) { |
| 176 theme_provider->Init(this); | 176 theme_provider->Init(this); |
| 177 created_theme_provider_ = true; | 177 created_theme_provider_ = true; |
| 178 theme_provider_ = theme_provider; | 178 theme_provider_.reset(theme_provider); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void TestingProfile::InitThemes() { | 181 void TestingProfile::InitThemes() { |
| 182 if (!created_theme_provider_) { | 182 if (!created_theme_provider_) { |
| 183 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) | 183 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
| 184 scoped_refptr<BrowserThemeProvider> themes(new GtkThemeProvider); | 184 theme_provider_.reset(new GtkThemeProvider); |
| 185 #else | 185 #else |
| 186 scoped_refptr<BrowserThemeProvider> themes(new BrowserThemeProvider); | 186 theme_provider_.reset(new BrowserThemeProvider); |
| 187 #endif | 187 #endif |
| 188 themes->Init(this); | 188 theme_provider_->Init(this); |
| 189 created_theme_provider_ = true; | 189 created_theme_provider_ = true; |
| 190 theme_provider_.swap(themes); | |
| 191 } | 190 } |
| 192 } | 191 } |
| 193 | 192 |
| 194 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { | 193 void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { |
| 195 DCHECK(history_service_.get()); | 194 DCHECK(history_service_.get()); |
| 196 DCHECK(MessageLoop::current()); | 195 DCHECK(MessageLoop::current()); |
| 197 | 196 |
| 198 CancelableRequestConsumer consumer; | 197 CancelableRequestConsumer consumer; |
| 199 history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); | 198 history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); |
| 200 MessageLoop::current()->Run(); | 199 MessageLoop::current()->Run(); |
| 201 } | 200 } |
| OLD | NEW |