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

Side by Side Diff: chrome/test/testing_browser_process.cc

Issue 6930034: Print Preview: Print in the background. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix build after r84303 Created 9 years, 7 months 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_browser_process.h" 5 #include "chrome/test/testing_browser_process.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/synchronization/waitable_event.h" 8 #include "base/synchronization/waitable_event.h"
9 #include "chrome/browser/google/google_url_tracker.h" 9 #include "chrome/browser/google/google_url_tracker.h"
10 #include "chrome/browser/notifications/notification_ui_manager.h" 10 #include "chrome/browser/notifications/notification_ui_manager.h"
11 #include "chrome/browser/policy/browser_policy_connector.h" 11 #include "chrome/browser/policy/browser_policy_connector.h"
12 #include "chrome/browser/policy/configuration_policy_pref_store.h" 12 #include "chrome/browser/policy/configuration_policy_pref_store.h"
13 #include "chrome/browser/policy/configuration_policy_provider.h" 13 #include "chrome/browser/policy/configuration_policy_provider.h"
14 #include "chrome/browser/policy/dummy_configuration_policy_provider.h" 14 #include "chrome/browser/policy/dummy_configuration_policy_provider.h"
15 #include "chrome/browser/prefs/pref_service.h" 15 #include "chrome/browser/prefs/pref_service.h"
16 #include "chrome/browser/printing/background_printing_manager.h"
16 #include "chrome/browser/profiles/profile_manager.h" 17 #include "chrome/browser/profiles/profile_manager.h"
17 #include "net/url_request/url_request_context_getter.h" 18 #include "net/url_request/url_request_context_getter.h"
18 #include "ui/base/clipboard/clipboard.h" 19 #include "ui/base/clipboard/clipboard.h"
19 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
20 21
21 TestingBrowserProcess::TestingBrowserProcess() 22 TestingBrowserProcess::TestingBrowserProcess()
22 : shutdown_event_(new base::WaitableEvent(true, false)), 23 : shutdown_event_(new base::WaitableEvent(true, false)),
23 module_ref_count_(0), 24 module_ref_count_(0),
24 app_locale_("en"), 25 app_locale_("en"),
25 local_state_(NULL) { 26 local_state_(NULL) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 172 }
172 173
173 void TestingBrowserProcess::InitDevToolsLegacyProtocolHandler(int port) { 174 void TestingBrowserProcess::InitDevToolsLegacyProtocolHandler(int port) {
174 } 175 }
175 176
176 unsigned int TestingBrowserProcess::AddRefModule() { 177 unsigned int TestingBrowserProcess::AddRefModule() {
177 return ++module_ref_count_; 178 return ++module_ref_count_;
178 } 179 }
179 180
180 unsigned int TestingBrowserProcess::ReleaseModule() { 181 unsigned int TestingBrowserProcess::ReleaseModule() {
181 DCHECK(module_ref_count_ > 0); 182 DCHECK_GT(module_ref_count_, 0U);
182 return --module_ref_count_; 183 return --module_ref_count_;
183 } 184 }
184 185
185 bool TestingBrowserProcess::IsShuttingDown() { 186 bool TestingBrowserProcess::IsShuttingDown() {
186 return false; 187 return false;
187 } 188 }
188 189
189 printing::PrintJobManager* TestingBrowserProcess::print_job_manager() { 190 printing::PrintJobManager* TestingBrowserProcess::print_job_manager() {
190 return NULL; 191 return NULL;
191 } 192 }
192 193
193 printing::PrintPreviewTabController* 194 printing::PrintPreviewTabController*
194 TestingBrowserProcess::print_preview_tab_controller() { 195 TestingBrowserProcess::print_preview_tab_controller() {
195 return NULL; 196 return NULL;
196 } 197 }
197 198
199 printing::BackgroundPrintingManager*
200 TestingBrowserProcess::background_printing_manager() {
201 if (!background_printing_manager_.get())
202 background_printing_manager_ = new printing::BackgroundPrintingManager();
203 return background_printing_manager_.get();
204 }
205
198 const std::string& TestingBrowserProcess::GetApplicationLocale() { 206 const std::string& TestingBrowserProcess::GetApplicationLocale() {
199 return app_locale_; 207 return app_locale_;
200 } 208 }
201 209
202 void TestingBrowserProcess::SetApplicationLocale( 210 void TestingBrowserProcess::SetApplicationLocale(
203 const std::string& app_locale) { 211 const std::string& app_locale) {
204 app_locale_ = app_locale; 212 app_locale_ = app_locale;
205 } 213 }
206 214
207 DownloadStatusUpdater* TestingBrowserProcess::download_status_updater() { 215 DownloadStatusUpdater* TestingBrowserProcess::download_status_updater() {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 252
245 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() { 253 ScopedTestingBrowserProcess::~ScopedTestingBrowserProcess() {
246 DCHECK_EQ(browser_process_.get(), g_browser_process); 254 DCHECK_EQ(browser_process_.get(), g_browser_process);
247 255
248 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. 256 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062.
249 // After the transition is over, we should just 257 // After the transition is over, we should just
250 // reset |g_browser_process| to NULL. 258 // reset |g_browser_process| to NULL.
251 browser_process_.reset(); 259 browser_process_.reset();
252 g_browser_process = new TestingBrowserProcess(); 260 g_browser_process = new TestingBrowserProcess();
253 } 261 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698