| OLD | NEW |
| 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/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/notifications/notification_ui_manager.h" | 8 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 9 #include "chrome/browser/policy/browser_policy_connector.h" | 9 #include "chrome/browser/policy/browser_policy_connector.h" |
| 10 #include "chrome/browser/policy/policy_service.h" | 10 #include "chrome/browser/policy/policy_service.h" |
| 11 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
| 12 #include "chrome/browser/prerender/prerender_tracker.h" | 12 #include "chrome/browser/prerender/prerender_tracker.h" |
| 13 #include "chrome/browser/printing/background_printing_manager.h" | 13 #include "chrome/browser/printing/background_printing_manager.h" |
| 14 #include "chrome/browser/printing/print_preview_tab_controller.h" | 14 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 16 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 17 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 18 #include "net/url_request/url_request_context_getter.h" | 18 #include "net/url_request/url_request_context_getter.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "ui/base/clipboard/clipboard.h" | |
| 21 | 20 |
| 22 #if !defined(ENABLE_CONFIGURATION_POLICY) | 21 #if !defined(ENABLE_CONFIGURATION_POLICY) |
| 23 #include "chrome/browser/policy/policy_service_stub.h" | 22 #include "chrome/browser/policy/policy_service_stub.h" |
| 24 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 23 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 25 | 24 |
| 26 TestingBrowserProcess::TestingBrowserProcess() | 25 TestingBrowserProcess::TestingBrowserProcess() |
| 27 : notification_service_(content::NotificationService::Create()), | 26 : notification_service_(content::NotificationService::Create()), |
| 28 module_ref_count_(0), | 27 module_ref_count_(0), |
| 29 app_locale_("en"), | 28 app_locale_("en"), |
| 30 local_state_(NULL), | 29 local_state_(NULL), |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 net::URLRequestContextGetter* TestingBrowserProcess::system_request_context() { | 117 net::URLRequestContextGetter* TestingBrowserProcess::system_request_context() { |
| 119 return NULL; | 118 return NULL; |
| 120 } | 119 } |
| 121 | 120 |
| 122 #if defined(OS_CHROMEOS) | 121 #if defined(OS_CHROMEOS) |
| 123 chromeos::OomPriorityManager* TestingBrowserProcess::oom_priority_manager() { | 122 chromeos::OomPriorityManager* TestingBrowserProcess::oom_priority_manager() { |
| 124 return NULL; | 123 return NULL; |
| 125 } | 124 } |
| 126 #endif // defined(OS_CHROMEOS) | 125 #endif // defined(OS_CHROMEOS) |
| 127 | 126 |
| 128 ui::Clipboard* TestingBrowserProcess::clipboard() { | |
| 129 if (!clipboard_.get()) { | |
| 130 // Note that we need a MessageLoop for the next call to work. | |
| 131 clipboard_.reset(new ui::Clipboard); | |
| 132 } | |
| 133 return clipboard_.get(); | |
| 134 } | |
| 135 | |
| 136 extensions::EventRouterForwarder* | 127 extensions::EventRouterForwarder* |
| 137 TestingBrowserProcess::extension_event_router_forwarder() { | 128 TestingBrowserProcess::extension_event_router_forwarder() { |
| 138 return NULL; | 129 return NULL; |
| 139 } | 130 } |
| 140 | 131 |
| 141 NotificationUIManager* TestingBrowserProcess::notification_ui_manager() { | 132 NotificationUIManager* TestingBrowserProcess::notification_ui_manager() { |
| 142 #if defined(ENABLE_NOTIFICATIONS) | 133 #if defined(ENABLE_NOTIFICATIONS) |
| 143 if (!notification_ui_manager_.get()) | 134 if (!notification_ui_manager_.get()) |
| 144 notification_ui_manager_.reset( | 135 notification_ui_manager_.reset( |
| 145 NotificationUIManager::Create(local_state())); | 136 NotificationUIManager::Create(local_state())); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 261 |
| 271 void TestingBrowserProcess::SetBrowserPolicyConnector( | 262 void TestingBrowserProcess::SetBrowserPolicyConnector( |
| 272 policy::BrowserPolicyConnector* connector) { | 263 policy::BrowserPolicyConnector* connector) { |
| 273 browser_policy_connector_.reset(connector); | 264 browser_policy_connector_.reset(connector); |
| 274 } | 265 } |
| 275 | 266 |
| 276 void TestingBrowserProcess::SetSafeBrowsingService( | 267 void TestingBrowserProcess::SetSafeBrowsingService( |
| 277 SafeBrowsingService* sb_service) { | 268 SafeBrowsingService* sb_service) { |
| 278 sb_service_ = sb_service; | 269 sb_service_ = sb_service; |
| 279 } | 270 } |
| OLD | NEW |