1 // Copyright 2015 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 COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_UTILS_H_
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_UTILS_H_
10 #include "content/public/browser/render_frame_host.h"
12 namespace dom_distiller
{
14 // Set the world for JavaScript to execute in. This can only be called once.
15 void SetDistillerJavaScriptWorldId(const int id
);
17 bool DistillerJavaScriptWorldIdIsSet();
19 // Execute JavaScript in an isolated world.
20 void RunIsolatedJavaScript(
21 content::RenderFrameHost
* render_frame_host
,
22 const std::string
& buffer
,
23 const content::RenderFrameHost::JavaScriptResultCallback
& callback
);
25 // Same as above without a callback.
26 void RunIsolatedJavaScript(content::RenderFrameHost
* render_frame_host
,
27 const std::string
& buffer
);
29 } // namespace dom_distiller
31 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_UTILS_H_