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
3 // found in the LICENSE file.
5 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h"
7 #include "content/public/browser/resource_context.h"
8 #if defined(FULL_SAFE_BROWSING)
9 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
12 using content::ResourceThrottle
;
15 SafeBrowsingResourceThrottleFactory
*
16 SafeBrowsingResourceThrottleFactory::factory_
= NULL
;
19 void SafeBrowsingResourceThrottleFactory::RegisterFactory(
20 SafeBrowsingResourceThrottleFactory
* factory
) {
25 ResourceThrottle
* SafeBrowsingResourceThrottleFactory::Create(
26 net::URLRequest
* request
,
27 content::ResourceContext
* resource_context
,
28 content::ResourceType resource_type
,
29 SafeBrowsingService
* service
) {
31 return factory_
->CreateResourceThrottle(
32 request
, resource_context
, resource_type
, service
);
34 #if defined(FULL_SAFE_BROWSING)
35 return new SafeBrowsingResourceThrottle(request
, resource_type
, service
);
36 #elif defined(MOBILE_SAFE_BROWSING)
39 #error Need to define {FULL|MOBILE} SAFE_BROWSING mode.