Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / renderer_host / safe_browsing_resource_throttle_factory.cc
blob99c913f3347799d59d7cab8f273de3129e556131
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"
10 #endif
12 using content::ResourceThrottle;
14 // static
15 SafeBrowsingResourceThrottleFactory*
16 SafeBrowsingResourceThrottleFactory::factory_ = NULL;
18 // static
19 void SafeBrowsingResourceThrottleFactory::RegisterFactory(
20 SafeBrowsingResourceThrottleFactory* factory) {
21 factory_ = factory;
24 // static
25 ResourceThrottle* SafeBrowsingResourceThrottleFactory::Create(
26 net::URLRequest* request,
27 content::ResourceContext* resource_context,
28 content::ResourceType resource_type,
29 SafeBrowsingService* service) {
30 if (factory_)
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)
37 return NULL;
38 #else
39 #error Need to define {FULL|MOBILE} SAFE_BROWSING mode.
40 #endif