1 // Copyright 2014 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 #ifndef CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSIONS_DISPATCHER_DELEGATE_H_
6 #define CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSIONS_DISPATCHER_DELEGATE_H_
8 #include "extensions/renderer/dispatcher_delegate.h"
10 class ChromeExtensionsDispatcherDelegate
11 : public extensions::DispatcherDelegate
{
13 ChromeExtensionsDispatcherDelegate();
14 virtual ~ChromeExtensionsDispatcherDelegate();
16 bool WasWebRequestUsedBySomeExtensions() const { return webrequest_used_
; }
19 // extensions::DispatcherDelegate implementation.
20 virtual scoped_ptr
<extensions::ScriptContext
> CreateScriptContext(
21 const v8::Handle
<v8::Context
>& v8_context
,
22 blink::WebFrame
* frame
,
23 const extensions::Extension
* extension
,
24 extensions::Feature::Context context_type
) OVERRIDE
;
25 virtual void InitOriginPermissions(const extensions::Extension
* extension
,
26 bool is_extension_active
) OVERRIDE
;
27 virtual void RegisterNativeHandlers(
28 extensions::Dispatcher
* dispatcher
,
29 extensions::ModuleSystem
* module_system
,
30 extensions::ScriptContext
* context
) OVERRIDE
;
31 virtual void PopulateSourceMap(
32 extensions::ResourceBundleSourceMap
* source_map
) OVERRIDE
;
33 virtual void RequireAdditionalModules(extensions::ScriptContext
* context
,
34 bool is_within_platform_app
) OVERRIDE
;
35 virtual void OnActiveExtensionsUpdated(
36 const std::set
<std::string
>& extensions_ids
) OVERRIDE
;
37 virtual void SetChannel(int channel
) OVERRIDE
;
38 virtual void ClearTabSpecificPermissions(
39 const extensions::Dispatcher
* dispatcher
,
41 const std::vector
<std::string
>& extension_ids
) OVERRIDE
;
42 virtual void UpdateTabSpecificPermissions(
43 const extensions::Dispatcher
* dispatcher
,
46 const std::string
& extension_id
,
47 const extensions::URLPatternSet
& origin_set
) OVERRIDE
;
48 virtual void HandleWebRequestAPIUsage(bool webrequest_used
) OVERRIDE
;
50 // Status of webrequest usage.
51 bool webrequest_used_
;
53 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsDispatcherDelegate
);
56 #endif // CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSIONS_DISPATCHER_DELEGATE_H_