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

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

Issue 16703025: [StorageMonitor] Move StorageMonitor ownership to BrowserProcessImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Catch up to SystemInfoStorage eject test Created 7 years, 5 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
« no previous file with comments | « chrome/test/base/testing_browser_process.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/testing_browser_process.h" 5 #include "chrome/test/base/testing_browser_process.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/background/background_mode_manager.h" 10 #include "chrome/browser/background/background_mode_manager.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/browser_process_impl.h"
12 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
13 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" 14 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h"
14 #include "chrome/test/base/testing_browser_process_platform_part.h" 15 #include "chrome/test/base/testing_browser_process_platform_part.h"
15 #include "content/public/browser/notification_service.h" 16 #include "content/public/browser/notification_service.h"
16 #include "net/url_request/url_request_context_getter.h" 17 #include "net/url_request/url_request_context_getter.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 #include "ui/message_center/message_center.h" 19 #include "ui/message_center/message_center.h"
19 20
20 #if !defined(OS_IOS) 21 #if !defined(OS_IOS)
21 #include "chrome/browser/media_galleries/media_file_system_registry.h"
22 #include "chrome/browser/notifications/notification_ui_manager.h" 22 #include "chrome/browser/notifications/notification_ui_manager.h"
23 #include "chrome/browser/prerender/prerender_tracker.h" 23 #include "chrome/browser/prerender/prerender_tracker.h"
24 #include "chrome/browser/printing/background_printing_manager.h" 24 #include "chrome/browser/printing/background_printing_manager.h"
25 #include "chrome/browser/printing/print_preview_dialog_controller.h" 25 #include "chrome/browser/printing/print_preview_dialog_controller.h"
26 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 26 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
27 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" 27 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h"
28 #endif 28 #endif
29 29
30 #if !defined(OS_IOS) && !defined(OS_ANDROID)
31 #include "chrome/browser/media_galleries/media_file_system_registry.h"
32 #include "chrome/browser/storage_monitor/storage_monitor.h"
33 #include "chrome/browser/storage_monitor/test_storage_monitor.h"
34 #endif
35
30 #if defined(ENABLE_CONFIGURATION_POLICY) 36 #if defined(ENABLE_CONFIGURATION_POLICY)
31 #include "chrome/browser/policy/browser_policy_connector.h" 37 #include "chrome/browser/policy/browser_policy_connector.h"
32 #else 38 #else
33 #include "chrome/browser/policy/policy_service_stub.h" 39 #include "chrome/browser/policy/policy_service_stub.h"
34 #endif // defined(ENABLE_CONFIGURATION_POLICY) 40 #endif // defined(ENABLE_CONFIGURATION_POLICY)
35 41
36 // static 42 // static
37 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { 43 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() {
38 return static_cast<TestingBrowserProcess*>(g_browser_process); 44 return static_cast<TestingBrowserProcess*>(g_browser_process);
39 } 45 }
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 317
312 BookmarkPromptController* TestingBrowserProcess::bookmark_prompt_controller() { 318 BookmarkPromptController* TestingBrowserProcess::bookmark_prompt_controller() {
313 #if defined(OS_IOS) 319 #if defined(OS_IOS)
314 NOTIMPLEMENTED(); 320 NOTIMPLEMENTED();
315 return NULL; 321 return NULL;
316 #else 322 #else
317 return bookmark_prompt_controller_.get(); 323 return bookmark_prompt_controller_.get();
318 #endif 324 #endif
319 } 325 }
320 326
327 chrome::StorageMonitor* TestingBrowserProcess::storage_monitor() {
328 #if defined(OS_IOS) || defined(OS_ANDROID)
329 NOTIMPLEMENTED();
330 return NULL;
331 #else
332 if (!storage_monitor_.get()) {
333 chrome::test::TestStorageMonitor* monitor =
334 new chrome::test::TestStorageMonitor();
335 monitor->Init();
336 monitor->MarkInitialized();
337 storage_monitor_.reset(monitor);
338 }
339 return storage_monitor_.get();
340 #endif
341 }
342
321 chrome::MediaFileSystemRegistry* 343 chrome::MediaFileSystemRegistry*
322 TestingBrowserProcess::media_file_system_registry() { 344 TestingBrowserProcess::media_file_system_registry() {
323 #if defined(OS_IOS) || defined (OS_ANDROID) 345 #if defined(OS_IOS) || defined(OS_ANDROID)
324 NOTIMPLEMENTED(); 346 NOTIMPLEMENTED();
325 return NULL; 347 return NULL;
326 #else 348 #else
327 if (!media_file_system_registry_) 349 if (!media_file_system_registry_)
328 media_file_system_registry_.reset(new chrome::MediaFileSystemRegistry()); 350 media_file_system_registry_.reset(new chrome::MediaFileSystemRegistry());
329 return media_file_system_registry_.get(); 351 return media_file_system_registry_.get();
330 #endif 352 #endif
331 } 353 }
332 354
333 bool TestingBrowserProcess::created_local_state() const { 355 bool TestingBrowserProcess::created_local_state() const {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 #endif 411 #endif
390 } 412 }
391 413
392 void TestingBrowserProcess::SetSafeBrowsingService( 414 void TestingBrowserProcess::SetSafeBrowsingService(
393 SafeBrowsingService* sb_service) { 415 SafeBrowsingService* sb_service) {
394 #if !defined(OS_IOS) 416 #if !defined(OS_IOS)
395 NOTIMPLEMENTED(); 417 NOTIMPLEMENTED();
396 sb_service_ = sb_service; 418 sb_service_ = sb_service;
397 #endif 419 #endif
398 } 420 }
421
422 void TestingBrowserProcess::SetStorageMonitor(
423 scoped_ptr<chrome::StorageMonitor> storage_monitor) {
424 #if !defined(OS_IOS) && !defined(OS_ANDROID)
425 storage_monitor_.reset(storage_monitor.release());
426 #endif
427 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_browser_process.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698