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. 4 5 #ifndef CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSIONS_DISPATCHER_DELEGATE_H_ 6 #define CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSIONS_DISPATCHER_DELEGATE_H_ 7 8 #include "extensions/renderer/dispatcher_delegate.h" 9 10 class ChromeExtensionsDispatcherDelegate 11 : public extensions::DispatcherDelegate { 12 public: 13 ChromeExtensionsDispatcherDelegate(); 14 virtual ~ChromeExtensionsDispatcherDelegate(); 15 16 private: 17 // extensions::DispatcherDelegate implementation. 18 virtual scoped_ptr<extensions::ScriptContext> CreateScriptContext( 19 const v8::Handle<v8::Context>& v8_context, 20 blink::WebFrame* frame, 21 const extensions::Extension* extension, 22 extensions::Feature::Context context_type, 23 const extensions::Extension* effective_extension, 24 extensions::Feature::Context effective_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, 40 int tab_id, 41 const std::vector<std::string>& extension_ids) OVERRIDE; 42 virtual void UpdateTabSpecificPermissions( 43 const extensions::Dispatcher* dispatcher, 44 const GURL& url, 45 int tab_id, 46 const std::string& extension_id, 47 const extensions::URLPatternSet& origin_set) OVERRIDE; 48 49 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsDispatcherDelegate); 50 }; 51 52 #endif // CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSIONS_DISPATCHER_DELEGATE_H_ 53