Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: content/public/renderer/content_renderer_client.h

Issue 10449063: Create default implementations of ContentRendererClient, ContentUtilityClient, and ContentPluginCli… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/renderer/content_renderer_client.h
===================================================================
--- content/public/renderer/content_renderer_client.h (revision 139356)
+++ content/public/renderer/content_renderer_client.h (working copy)
@@ -13,6 +13,7 @@
#include "ipc/ipc_message.h"
#include "content/public/common/content_client.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityState.h"
+#include "v8/include/v8.h"
class FilePath;
class GURL;
@@ -47,34 +48,29 @@
class WebMediaPlayerImpl;
}
-namespace v8 {
-class Context;
-template<class T> class Handle;
tfarina 2012/05/30 00:10:33 why not keep these forward declarations? I guess i
jam 2012/05/30 14:50:21 I had to include v8.h after I inlined some methods
-}
-
namespace content {
class RenderView;
// Embedder API for participating in renderer logic.
-class ContentRendererClient {
+class CONTENT_EXPORT ContentRendererClient {
public:
virtual ~ContentRendererClient() {}
// Notifies us that the RenderThread has been created.
- virtual void RenderThreadStarted() = 0;
+ virtual void RenderThreadStarted() {}
// Notifies that a new RenderView has been created.
- virtual void RenderViewCreated(RenderView* render_view) = 0;
+ virtual void RenderViewCreated(RenderView* render_view) {}
// Sets a number of views/tabs opened in this process.
- virtual void SetNumberOfViews(int number_of_views) = 0;
+ virtual void SetNumberOfViews(int number_of_views) {}
// Returns the bitmap to show when a plugin crashed, or NULL for none.
- virtual SkBitmap* GetSadPluginBitmap() = 0;
+ virtual SkBitmap* GetSadPluginBitmap();
// Returns the default text encoding.
- virtual std::string GetDefaultEncoding() = 0;
+ virtual std::string GetDefaultEncoding();
// Allows the embedder to override creating a plugin. If it returns true, then
// |plugin| will contain the created plugin, although it could be NULL. If it
@@ -83,20 +79,20 @@
RenderView* render_view,
WebKit::WebFrame* frame,
const WebKit::WebPluginParams& params,
- WebKit::WebPlugin** plugin) = 0;
+ WebKit::WebPlugin** plugin);
// Creates a replacement plug-in that is shown when the plug-in at |file_path|
// couldn't be loaded. This allows the embedder to show a custom placeholder.
virtual WebKit::WebPlugin* CreatePluginReplacement(
RenderView* render_view,
- const FilePath& plugin_path) = 0;
+ const FilePath& plugin_path);
// Returns true if the embedder has an error page to show for the given http
// status code. If so |error_domain| should be set to according to WebURLError
// and the embedder's GetNavigationErrorHtml will be called afterwards to get
// the error html.
virtual bool HasErrorPage(int http_status_code,
- std::string* error_domain) = 0;
+ std::string* error_domain);
// Returns the information to display when a navigation error occurs.
// If |error_html| is not null then it may be set to a HTML page containing
@@ -110,7 +106,7 @@
const WebKit::WebURLRequest& failed_request,
const WebKit::WebURLError& error,
std::string* error_html,
- string16* error_description) = 0;
+ string16* error_description) {}
// Allows embedder to override creating a WebMediaPlayerImpl. If it returns
// NULL the content layer will create the media player.
@@ -123,65 +119,65 @@
WebKit::WebAudioSourceProvider* audio_source_provider,
media::MessageLoopFactory* message_loop_factory,
webkit_media::MediaStreamClient* media_stream_client,
- media::MediaLog* media_log) = 0;
+ media::MediaLog* media_log);
// Returns true if the renderer process should schedule the idle handler when
// all widgets are hidden.
- virtual bool RunIdleHandlerWhenWidgetsHidden() = 0;
+ virtual bool RunIdleHandlerWhenWidgetsHidden();
// Returns true if the given url can create popup windows.
- virtual bool AllowPopup(const GURL& creator) = 0;
+ virtual bool AllowPopup(const GURL& creator);
// Returns true if we should fork a new process for the given navigation.
virtual bool ShouldFork(WebKit::WebFrame* frame,
const GURL& url,
bool is_initial_navigation,
- bool* send_referrer) = 0;
+ bool* send_referrer);
// Notifies the embedder that the given frame is requesting the resource at
// |url|. If the function returns true, the url is changed to |new_url|.
virtual bool WillSendRequest(WebKit::WebFrame* frame,
const GURL& url,
- GURL* new_url) = 0;
+ GURL* new_url);
// Whether to pump events when sending sync cookie messages. Needed if the
// embedder can potentiall put up a modal dialog on the UI thread as a result.
- virtual bool ShouldPumpEventsDuringCookieMessage() = 0;
+ virtual bool ShouldPumpEventsDuringCookieMessage();
// See the corresponding functions in WebKit::WebFrameClient.
virtual void DidCreateScriptContext(WebKit::WebFrame* frame,
v8::Handle<v8::Context> context,
int extension_group,
- int world_id) = 0;
+ int world_id) {}
virtual void WillReleaseScriptContext(WebKit::WebFrame* frame,
v8::Handle<v8::Context>,
- int world_id) = 0;
+ int world_id) {}
// See WebKit::WebKitPlatformSupport.
virtual unsigned long long VisitedLinkHash(const char* canonical_url,
- size_t length) = 0;
- virtual bool IsLinkVisited(unsigned long long link_hash) = 0;
- virtual void PrefetchHostName(const char* hostname, size_t length) = 0;
+ size_t length);
+ virtual bool IsLinkVisited(unsigned long long link_hash);
+ virtual void PrefetchHostName(const char* hostname, size_t length) {}
virtual bool ShouldOverridePageVisibilityState(
const RenderView* render_view,
- WebKit::WebPageVisibilityState* override_state) const = 0;
+ WebKit::WebPageVisibilityState* override_state) const;
// Return true if the GetCookie request will be handled by the embedder.
// Cookies are returned in the cookie parameter.
virtual bool HandleGetCookieRequest(RenderView* sender,
const GURL& url,
const GURL& first_party_for_cookies,
- std::string* cookies) = 0;
+ std::string* cookies);
// Return true if the SetCookie request will be handled by the embedder.
// Cookies to be set are passed in the value parameter.
virtual bool HandleSetCookieRequest(RenderView* sender,
const GURL& url,
const GURL& first_party_for_cookies,
- const std::string& value) = 0;
+ const std::string& value);
virtual void RegisterPPAPIInterfaceFactories(
- webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) = 0;
+ webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {}
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698