1 // Copyright 2012 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 ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_
6 #define ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_
8 #include "content/public/renderer/content_renderer_client.h"
10 #include "android_webview/renderer/aw_render_process_observer.h"
11 #include "base/compiler_specific.h"
13 namespace visitedlink
{
14 class VisitedLinkSlave
;
17 namespace android_webview
{
19 class AwContentRendererClient
: public content::ContentRendererClient
{
21 AwContentRendererClient();
22 virtual ~AwContentRendererClient();
24 // ContentRendererClient implementation.
25 virtual void RenderThreadStarted() override
;
26 virtual void RenderFrameCreated(content::RenderFrame
* render_frame
) override
;
27 virtual void RenderViewCreated(content::RenderView
* render_view
) override
;
28 virtual bool HasErrorPage(int http_status_code
,
29 std::string
* error_domain
) override
;
30 virtual void GetNavigationErrorStrings(
31 content::RenderView
* render_view
,
32 blink::WebFrame
* frame
,
33 const blink::WebURLRequest
& failed_request
,
34 const blink::WebURLError
& error
,
35 std::string
* error_html
,
36 base::string16
* error_description
) override
;
37 virtual unsigned long long VisitedLinkHash(const char* canonical_url
,
38 size_t length
) override
;
39 virtual bool IsLinkVisited(unsigned long long link_hash
) override
;
40 virtual void AddKeySystems(
41 std::vector
<media::KeySystemInfo
>* key_systems
) override
;
43 virtual bool HandleNavigation(content::RenderFrame
* render_frame
,
44 content::DocumentState
* document_state
,
46 blink::WebFrame
* frame
,
47 const blink::WebURLRequest
& request
,
48 blink::WebNavigationType type
,
49 blink::WebNavigationPolicy default_policy
,
50 bool is_redirect
) override
;
51 virtual bool ShouldOverridePageVisibilityState(
52 const content::RenderFrame
* render_frame
,
53 blink::WebPageVisibilityState
* override_state
) override
;
56 scoped_ptr
<AwRenderProcessObserver
> aw_render_process_observer_
;
57 scoped_ptr
<visitedlink::VisitedLinkSlave
> visited_link_slave_
;
60 } // namespace android_webview
62 #endif // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_