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 EXTENSIONS_RENDERER_EXTENSIONS_RENDERER_CLIENT_H_
6 #define EXTENSIONS_RENDERER_EXTENSIONS_RENDERER_CLIENT_H_
8 class ResourceBundleSourceMap
;
10 namespace extensions
{
12 // Interface to allow the extensions module to make render-process-specific
13 // queries of the embedder. Should be Set() once in the render process.
15 // NOTE: Methods that do not require knowledge of renderer concepts should be
16 // added in ExtensionsClient (extensions/common/extensions_client.h) even if
17 // they are only used in the renderer process.
18 class ExtensionsRendererClient
{
20 virtual ~ExtensionsRendererClient() {}
22 // Returns true if the current render process was launched incognito.
23 virtual bool IsIncognitoProcess() const = 0;
25 // Returns the lowest isolated world ID available to extensions.
26 // Must be greater than 0. See blink::WebFrame::executeScriptInIsolatedWorld
27 // (third_party/WebKit/public/web/WebFrame.h) for additional context.
28 virtual int GetLowestIsolatedWorldId() const = 0;
30 // Returns the single instance of |this|.
31 static ExtensionsRendererClient
* Get();
33 // Initialize the single instance.
34 static void Set(ExtensionsRendererClient
* client
);
37 } // namespace extensions
39 #endif // EXTENSIONS_RENDERER_EXTENSIONS_RENDERER_CLIENT_H_