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 "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 23 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
24 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" | 24 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" |
25 #endif | 25 #endif |
26 | 26 |
27 #if defined(ENABLE_CONFIGURATION_POLICY) | 27 #if defined(ENABLE_CONFIGURATION_POLICY) |
28 #include "chrome/browser/policy/browser_policy_connector.h" | 28 #include "chrome/browser/policy/browser_policy_connector.h" |
29 #else | 29 #else |
30 #include "chrome/browser/policy/policy_service_stub.h" | 30 #include "chrome/browser/policy/policy_service_stub.h" |
31 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 31 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
32 | 32 |
| 33 #if defined(ENABLE_MESSAGE_CENTER) && defined(USE_ASH) |
| 34 #include "ash/shell.h" |
| 35 #endif |
| 36 |
| 37 #if defined(ENABLE_MESSAGE_CENTER) |
| 38 #include "ui/message_center/message_center.h" |
| 39 #endif |
| 40 |
33 // static | 41 // static |
34 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { | 42 TestingBrowserProcess* TestingBrowserProcess::GetGlobal() { |
35 return static_cast<TestingBrowserProcess*>(g_browser_process); | 43 return static_cast<TestingBrowserProcess*>(g_browser_process); |
36 } | 44 } |
37 | 45 |
38 TestingBrowserProcess::TestingBrowserProcess() | 46 TestingBrowserProcess::TestingBrowserProcess() |
39 : notification_service_(content::NotificationService::Create()), | 47 : notification_service_(content::NotificationService::Create()), |
40 module_ref_count_(0), | 48 module_ref_count_(0), |
41 app_locale_("en"), | 49 app_locale_("en"), |
42 #if !defined(OS_IOS) | 50 #if !defined(OS_IOS) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (!notification_ui_manager_.get()) | 189 if (!notification_ui_manager_.get()) |
182 notification_ui_manager_.reset( | 190 notification_ui_manager_.reset( |
183 NotificationUIManager::Create(local_state())); | 191 NotificationUIManager::Create(local_state())); |
184 return notification_ui_manager_.get(); | 192 return notification_ui_manager_.get(); |
185 #else | 193 #else |
186 NOTIMPLEMENTED(); | 194 NOTIMPLEMENTED(); |
187 return NULL; | 195 return NULL; |
188 #endif | 196 #endif |
189 } | 197 } |
190 | 198 |
| 199 #if defined(ENABLE_MESSAGE_CENTER) |
| 200 message_center::MessageCenter* TestingBrowserProcess::message_center() { |
| 201 #if defined(USE_ASH) |
| 202 return ash::Shell::GetInstance()->message_center(); |
| 203 #else |
| 204 if (!message_center_.get()) |
| 205 message_center_.reset(new message_center::MessageCenter()); |
| 206 return message_center_.get(); |
| 207 #endif |
| 208 } |
| 209 #endif |
| 210 |
191 IntranetRedirectDetector* TestingBrowserProcess::intranet_redirect_detector() { | 211 IntranetRedirectDetector* TestingBrowserProcess::intranet_redirect_detector() { |
192 return NULL; | 212 return NULL; |
193 } | 213 } |
194 | 214 |
195 AutomationProviderList* TestingBrowserProcess::GetAutomationProviderList() { | 215 AutomationProviderList* TestingBrowserProcess::GetAutomationProviderList() { |
196 return NULL; | 216 return NULL; |
197 } | 217 } |
198 | 218 |
199 void TestingBrowserProcess::CreateDevToolsHttpProtocolHandler( | 219 void TestingBrowserProcess::CreateDevToolsHttpProtocolHandler( |
200 Profile* profile, | 220 Profile* profile, |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 #endif | 380 #endif |
361 } | 381 } |
362 | 382 |
363 void TestingBrowserProcess::SetSafeBrowsingService( | 383 void TestingBrowserProcess::SetSafeBrowsingService( |
364 SafeBrowsingService* sb_service) { | 384 SafeBrowsingService* sb_service) { |
365 #if !defined(OS_IOS) | 385 #if !defined(OS_IOS) |
366 NOTIMPLEMENTED(); | 386 NOTIMPLEMENTED(); |
367 sb_service_ = sb_service; | 387 sb_service_ = sb_service; |
368 #endif | 388 #endif |
369 } | 389 } |
OLD | NEW |