summaryrefslogtreecommitdiffstats
path: root/android_webview/renderer/aw_content_renderer_client.h
blob: f6ffcbffc920f764c852a9d520d4d7ba703fc52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_
#define ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_

#include "content/public/renderer/content_renderer_client.h"

#include "android_webview/renderer/aw_render_process_observer.h"
#include "base/compiler_specific.h"

namespace visitedlink {
class VisitedLinkSlave;
}

namespace android_webview {

class AwContentRendererClient : public content::ContentRendererClient {
 public:
  AwContentRendererClient();
  virtual ~AwContentRendererClient();

  // ContentRendererClient implementation.
  virtual void RenderThreadStarted() override;
  virtual void RenderFrameCreated(content::RenderFrame* render_frame) override;
  virtual void RenderViewCreated(content::RenderView* render_view) override;
  virtual bool HasErrorPage(int http_status_code,
                            std::string* error_domain) override;
  virtual void GetNavigationErrorStrings(
      content::RenderView* render_view,
      blink::WebFrame* frame,
      const blink::WebURLRequest& failed_request,
      const blink::WebURLError& error,
      std::string* error_html,
      base::string16* error_description) override;
  virtual unsigned long long VisitedLinkHash(const char* canonical_url,
                                             size_t length) override;
  virtual bool IsLinkVisited(unsigned long long link_hash) override;
  virtual void AddKeySystems(
      std::vector<media::KeySystemInfo>* key_systems) override;

  virtual bool HandleNavigation(content::RenderFrame* render_frame,
                                content::DocumentState* document_state,
                                int opener_id,
                                blink::WebFrame* frame,
                                const blink::WebURLRequest& request,
                                blink::WebNavigationType type,
                                blink::WebNavigationPolicy default_policy,
                                bool is_redirect) override;
  virtual bool ShouldOverridePageVisibilityState(
      const content::RenderFrame* render_frame,
      blink::WebPageVisibilityState* override_state) override;

 private:
  scoped_ptr<AwRenderProcessObserver> aw_render_process_observer_;
  scoped_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_;
};

}  // namespace android_webview

#endif  // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_