content_renderer_client.h revision 7dbb3d5cf0c15f500944d211057644d6a2f37371
1e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek// Use of this source code is governed by a BSD-style license that can be
3395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek// found in the LICENSE file.
4395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek
5395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#ifndef CONTENT_PUBLIC_RENDERER_CONTENT_RENDERER_CLIENT_H_
6395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#define CONTENT_PUBLIC_RENDERER_CONTENT_RENDERER_CLIENT_H_
7395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek
8395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#include <string>
9395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek
10395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#include "base/memory/weak_ptr.h"
11395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#include "base/strings/string16.h"
12395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#include "content/public/common/content_client.h"
13395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#include "content/public/common/page_transition_types.h"
14395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#include "ipc/ipc_message.h"
15395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
167dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis#include "third_party/WebKit/public/web/WebNavigationType.h"
172fa67efeaf66a9332c30a026dc1c21bef6c33a6cBenjamin Kramer#include "third_party/WebKit/public/web/WebPageVisibilityState.h"
18395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek#include "v8/include/v8.h"
192fa67efeaf66a9332c30a026dc1c21bef6c33a6cBenjamin Kramer
202fa67efeaf66a9332c30a026dc1c21bef6c33a6cBenjamin Kramerclass GURL;
21395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenekclass SkBitmap;
2258652887b08da3207226ec6d8bdb59ec0e96edfeBenjamin Kramer
2355fc873017f10f6f566b182b70f6fc22aefa3464Chandler Carruthnamespace base {
2455fc873017f10f6f566b182b70f6fc22aefa3464Chandler Carruthclass FilePath;
2555fc873017f10f6f566b182b70f6fc22aefa3464Chandler Carruthclass MessageLoop;
26395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek}
27395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek
289ef6537a894c33003359b1f9b9676e9178e028b7Ted Kremeneknamespace WebKit {
29395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenekclass WebAudioDevice;
30395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenekclass WebClipboard;
310b2dd776318e612c682d32e1f4ca70f7b223c05eTed Kremenekclass WebFrame;
32395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenekclass WebHyphenator;
339c378f705405d37f49795d5e915989de774fe11fTed Kremenekclass WebMIDIAccessor;
34395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenekclass WebMIDIAccessorClient;
35395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenekclass WebMediaStreamCenter;
361eb4433ac451dc16f4133a88af2d002ac26c58efMike Stumpclass WebMediaStreamCenterClient;
3735ffcf3c2a054ee124fe8d47152c5d1bcdf86261Ted Kremenekclass WebPlugin;
3835ffcf3c2a054ee124fe8d47152c5d1bcdf86261Ted Kremenekclass WebPluginContainer;
39395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenekclass WebPrescientNetworking;
400b2dd776318e612c682d32e1f4ca70f7b223c05eTed Kremenekclass WebRTCPeerConnectionHandler;
410b2dd776318e612c682d32e1f4ca70f7b223c05eTed Kremenekclass WebRTCPeerConnectionHandlerClient;
42694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenekclass WebSpeechSynthesizer;
43395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenekclass WebSpeechSynthesizerClient;
441eb4433ac451dc16f4133a88af2d002ac26c58efMike Stumpclass WebThemeEngine;
4535ffcf3c2a054ee124fe8d47152c5d1bcdf86261Ted Kremenekclass WebURLRequest;
4635ffcf3c2a054ee124fe8d47152c5d1bcdf86261Ted Kremenekstruct WebPluginParams;
4735ffcf3c2a054ee124fe8d47152c5d1bcdf86261Ted Kremenekstruct WebURLError;
4835ffcf3c2a054ee124fe8d47152c5d1bcdf86261Ted Kremenek}
4935ffcf3c2a054ee124fe8d47152c5d1bcdf86261Ted Kremenek
5035ffcf3c2a054ee124fe8d47152c5d1bcdf86261Ted Kremeneknamespace webkit {
515ec351c9507f12d5bede569c51d5257fad167134Anna Zaksnamespace ppapi {
525ec351c9507f12d5bede569c51d5257fad167134Anna Zaksclass PpapiInterfaceFactoryManager;
535ec351c9507f12d5bede569c51d5257fad167134Anna Zaks}
545ec351c9507f12d5bede569c51d5257fad167134Anna Zaksstruct WebPluginInfo;
555ec351c9507f12d5bede569c51d5257fad167134Anna Zaks}
565ec351c9507f12d5bede569c51d5257fad167134Anna Zaks
575ec351c9507f12d5bede569c51d5257fad167134Anna Zaksnamespace content {
585ec351c9507f12d5bede569c51d5257fad167134Anna Zaks
595ec351c9507f12d5bede569c51d5257fad167134Anna Zaksclass RenderView;
600b2dd776318e612c682d32e1f4ca70f7b223c05eTed Kremenekclass SynchronousCompositor;
61694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek
62694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek// Embedder API for participating in renderer logic.
63694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenekclass CONTENT_EXPORT ContentRendererClient {
649c378f705405d37f49795d5e915989de774fe11fTed Kremenek public:
65694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek  virtual ~ContentRendererClient() {}
66694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek
671eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // Notifies us that the RenderThread has been created.
689c378f705405d37f49795d5e915989de774fe11fTed Kremenek  virtual void RenderThreadStarted() {}
69694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek
70694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek  // Notifies that a new RenderView has been created.
71694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek  virtual void RenderViewCreated(RenderView* render_view) {}
721eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump
73694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek  // Sets a number of views/tabs opened in this process.
740b2dd776318e612c682d32e1f4ca70f7b223c05eTed Kremenek  virtual void SetNumberOfViews(int number_of_views) {}
750b2dd776318e612c682d32e1f4ca70f7b223c05eTed Kremenek
76395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // Returns the bitmap to show when a plugin crashed, or NULL for none.
77395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  virtual SkBitmap* GetSadPluginBitmap();
789c378f705405d37f49795d5e915989de774fe11fTed Kremenek
798fa3a1a6732dda5e4bd8815cc64ab516da5c19fcTed Kremenek  // Returns the bitmap to show when a <webview> guest has crashed, or NULL for
80651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  // none.
81651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  virtual SkBitmap* GetSadWebViewBitmap();
82e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek
83e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek  // Returns the default text encoding.
848fa3a1a6732dda5e4bd8815cc64ab516da5c19fcTed Kremenek  virtual std::string GetDefaultEncoding();
858fa3a1a6732dda5e4bd8815cc64ab516da5c19fcTed Kremenek
86651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  // Allows the embedder to override creating a plugin. If it returns true, then
87651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  // |plugin| will contain the created plugin, although it could be NULL. If it
88e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek  // returns false, the content layer will create the plugin.
89e8ec699167a7c3a2872feefd03e0ea2fabb980e0Ted Kremenek  virtual bool OverrideCreatePlugin(
90651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines      RenderView* render_view,
91d329724745b49f894b768d47275b7c2713106e89Douglas Gregor      WebKit::WebFrame* frame,
92e8ec699167a7c3a2872feefd03e0ea2fabb980e0Ted Kremenek      const WebKit::WebPluginParams& params,
93e8ec699167a7c3a2872feefd03e0ea2fabb980e0Ted Kremenek      WebKit::WebPlugin** plugin);
948fa3a1a6732dda5e4bd8815cc64ab516da5c19fcTed Kremenek
958fa3a1a6732dda5e4bd8815cc64ab516da5c19fcTed Kremenek  // Creates a replacement plug-in that is shown when the plug-in at |file_path|
968fa3a1a6732dda5e4bd8815cc64ab516da5c19fcTed Kremenek  // couldn't be loaded. This allows the embedder to show a custom placeholder.
97b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  virtual WebKit::WebPlugin* CreatePluginReplacement(
98b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek      RenderView* render_view,
99651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines      const base::FilePath& plugin_path);
100651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
101b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // Returns true if the embedder has an error page to show for the given http
102e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek  // status code. If so |error_domain| should be set to according to WebURLError
103b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // and the embedder's GetNavigationErrorHtml will be called afterwards to get
104b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // the error html.
105b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  virtual bool HasErrorPage(int http_status_code,
106b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek                            std::string* error_domain);
1077dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis
108651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  // Returns the information to display when a navigation error occurs.
109651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  // If |error_html| is not null then it may be set to a HTML page containing
110395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // the details of the error and maybe links to more info.
1119c378f705405d37f49795d5e915989de774fe11fTed Kremenek  // If |error_description| is not null it may be set to contain a brief
112395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // message describing the error that has occurred.
113395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // Either of the out parameters may be not written to in certain cases
114395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // (lack of information on the error code) so the caller should take care to
115651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  // initialize the string values with safe defaults before the call.
116e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek  virtual void GetNavigationErrorStrings(
117e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek      WebKit::WebFrame* frame,
118e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek      const WebKit::WebURLRequest& failed_request,
119e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek      const WebKit::WebURLError& error,
120ed50a8a7a8b5fbb5d365b39c81ec389e19e4360eTed Kremenek      std::string* error_html,
121651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines      string16* error_description) {}
122651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
123651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  // Allows the embedder to control when media resources are loaded. Embedders
124651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  // can run |closure| immediately if they don't wish to defer media resource
125395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // loading.
1261eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  virtual void DeferMediaLoad(RenderView* render_view,
127651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines                              const base::Closure& closure);
128395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek
129395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // Allows the embedder to override creating a WebMediaStreamCenter. If it
130395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // returns NULL the content layer will create the stream center.
131395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  virtual WebKit::WebMediaStreamCenter* OverrideCreateWebMediaStreamCenter(
132e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek      WebKit::WebMediaStreamCenterClient* client);
1338fa3a1a6732dda5e4bd8815cc64ab516da5c19fcTed Kremenek
1348fa3a1a6732dda5e4bd8815cc64ab516da5c19fcTed Kremenek  // Allows the embedder to override creating a WebRTCPeerConnectionHandler. If
1351eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump  // it returns NULL the content layer will create the connection handler.
136b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  virtual WebKit::WebRTCPeerConnectionHandler*
137b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  OverrideCreateWebRTCPeerConnectionHandler(
138b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek      WebKit::WebRTCPeerConnectionHandlerClient* client);
139b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek
140b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // Allows the embedder to override creating a WebMIDIAccessor.  If it
141b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // returns NULL the content layer will create the MIDI accessor.
142b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  virtual WebKit::WebMIDIAccessor* OverrideCreateMIDIAccessor(
143e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek      WebKit::WebMIDIAccessorClient* client);
144b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek
145b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // Allows the embedder to override creating a WebAudioDevice.  If it
146e3972a902d4a6f61fb21df092da2cace2b16cb3eTed Kremenek  // returns NULL the content layer will create the audio device.
147b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  virtual WebKit::WebAudioDevice* OverrideCreateAudioDevice(
148b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek      double sample_rate);
149b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek
150b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // Allows the embedder to override the WebKit::WebClipboard used. If it
151b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // returns NULL the content layer will handle clipboard interactions.
152b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  virtual WebKit::WebClipboard* OverrideWebClipboard();
153b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek
154b221e4fb46f6e35b0721399ed2734daadbcc1f00Ted Kremenek  // Allows the embedder to override the WebKit::WebHyphenator used. If it
155395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // returns NULL the content layer will handle hyphenation.
156395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  virtual WebKit::WebHyphenator* OverrideWebHyphenator();
157395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek
15853ba0b636194dbeaa65a6f85316c9397a0c5298bTed Kremenek  // Allows the embedder to override the WebThemeEngine used. If it returns NULL
15953ba0b636194dbeaa65a6f85316c9397a0c5298bTed Kremenek  // the content layer will provide an engine.
160b8989f27f116ff2400e92a52c067a69846119eb5Benjamin Kramer  virtual WebKit::WebThemeEngine* OverrideThemeEngine();
161694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek
162694eefb7452dd650bae16e1026571ab5a43a74fcTed Kremenek  // Allows the embedder to override the WebSpeechSynthesizer used.
163cc87ba2b950cfef2ef43019627330975a7daf73aTed Kremenek  // If it returns NULL the content layer will provide an engine.
164590dd8e0959d8df5621827768987c4792b74fc06Anna Zaks  virtual WebKit::WebSpeechSynthesizer* OverrideSpeechSynthesizer(
165590dd8e0959d8df5621827768987c4792b74fc06Anna Zaks      WebKit::WebSpeechSynthesizerClient* client);
166651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
167590dd8e0959d8df5621827768987c4792b74fc06Anna Zaks  // Returns true if the renderer process should schedule the idle handler when
168395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  // all widgets are hidden.
169395aaf20d6e1ab04741562dc6b7d47164bcbd87eTed Kremenek  virtual bool RunIdleHandlerWhenWidgetsHidden();
1707dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis
1717dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis  // Returns true if a popup window should be allowed.
1727dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis  virtual bool AllowPopup();
1737dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis
1747dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis  // Returns true if the navigation was handled by the embedder and should be
1757dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis  // ignored by WebKit. This method is used by CEF.
176ec8605f1d7ec846dbf51047bfd5c56d32d1ff91cArgyrios Kyrtzidis  virtual bool HandleNavigation(WebKit::WebFrame* frame,
1777dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                                const WebKit::WebURLRequest& request,
1787dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                                WebKit::WebNavigationType type,
1797dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                                WebKit::WebNavigationPolicy default_policy,
1807dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                                bool is_redirect);
181651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines
1827dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis  // Returns true if we should fork a new process for the given navigation.
1837dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis  virtual bool ShouldFork(WebKit::WebFrame* frame,
1847dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                          const GURL& url,
1857dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                          const std::string& http_method,
1867dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                          bool is_initial_navigation,
1877dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                          bool is_server_redirect,
1887dd445ec20e704846cfbdb132e56539280d71311Argyrios Kyrtzidis                          bool* send_referrer);
189
190  // Notifies the embedder that the given frame is requesting the resource at
191  // |url|.  If the function returns true, the url is changed to |new_url|.
192  virtual bool WillSendRequest(WebKit::WebFrame* frame,
193                               PageTransition transition_type,
194                               const GURL& url,
195                               const GURL& first_party_for_cookies,
196                               GURL* new_url);
197
198  // Whether to pump events when sending sync cookie messages.  Needed if the
199  // embedder can potentiall put up a modal dialog on the UI thread as a result.
200  virtual bool ShouldPumpEventsDuringCookieMessage();
201
202  // See the corresponding functions in WebKit::WebFrameClient.
203  virtual void DidCreateScriptContext(WebKit::WebFrame* frame,
204                                      v8::Handle<v8::Context> context,
205                                      int extension_group,
206                                      int world_id) {}
207  virtual void WillReleaseScriptContext(WebKit::WebFrame* frame,
208                                        v8::Handle<v8::Context>,
209                                        int world_id) {}
210
211  // See WebKit::Platform.
212  virtual unsigned long long VisitedLinkHash(const char* canonical_url,
213                                             size_t length);
214  virtual bool IsLinkVisited(unsigned long long link_hash);
215  virtual void PrefetchHostName(const char* hostname, size_t length) {}
216  virtual WebKit::WebPrescientNetworking* GetPrescientNetworking();
217  virtual bool ShouldOverridePageVisibilityState(
218      const RenderView* render_view,
219      WebKit::WebPageVisibilityState* override_state) const;
220
221  // Return true if the GetCookie request will be handled by the embedder.
222  // Cookies are returned in the cookie parameter.
223  virtual bool HandleGetCookieRequest(RenderView* sender,
224                                      const GURL& url,
225                                      const GURL& first_party_for_cookies,
226                                      std::string* cookies);
227
228  // Return true if the SetCookie request will be handled by the embedder.
229  // Cookies to be set are passed in the value parameter.
230  virtual bool HandleSetCookieRequest(RenderView* sender,
231                                      const GURL& url,
232                                      const GURL& first_party_for_cookies,
233                                      const std::string& value);
234
235  virtual void RegisterPPAPIInterfaceFactories(
236      webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {}
237
238  // Returns true if plugin living in the container can use
239  // pp::FileIO::RequestOSFileHandle.
240  virtual bool IsPluginAllowedToCallRequestOSFileHandle(
241      WebKit::WebPluginContainer* container) const;
242
243  // Returns whether BrowserPlugin should be allowed within the |container|.
244  virtual bool AllowBrowserPlugin(WebKit::WebPluginContainer* container) const;
245
246  // Returns true if the page at |url| can use Pepper MediaStream APIs.
247  virtual bool AllowPepperMediaStreamAPI(const GURL& url) const;
248};
249
250}  // namespace content
251
252#endif  // CONTENT_PUBLIC_RENDERER_CONTENT_RENDERER_CLIENT_H_
253