| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ |
| 6 #define ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "content/public/renderer/content_renderer_client.h" | 8 #include "content/public/renderer/content_renderer_client.h" |
| 9 | 9 |
| 10 #include "android_webview/renderer/aw_render_process_observer.h" | 10 #include "android_webview/renderer/aw_render_process_observer.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 | 12 |
| 13 namespace components { | 13 namespace components { |
| 14 class VisitedLinkSlave; | 14 class VisitedLinkSlave; |
| 15 } // namespace components | 15 } // namespace components |
| 16 | 16 |
| 17 namespace android_webview { | 17 namespace android_webview { |
| 18 | 18 |
| 19 class AwContentRendererClient : public content::ContentRendererClient { | 19 class AwContentRendererClient : public content::ContentRendererClient { |
| 20 public: | 20 public: |
| 21 typedef MessageLoop* CompositorMessageLoopGetter(); | 21 typedef base::MessageLoop* CompositorMessageLoopGetter(); |
| 22 | 22 |
| 23 explicit AwContentRendererClient( | 23 explicit AwContentRendererClient( |
| 24 CompositorMessageLoopGetter* compositor_message_loop_getter, | 24 CompositorMessageLoopGetter* compositor_message_loop_getter, |
| 25 bool should_create_compositor_input_handler); | 25 bool should_create_compositor_input_handler); |
| 26 virtual ~AwContentRendererClient(); | 26 virtual ~AwContentRendererClient(); |
| 27 | 27 |
| 28 // ContentRendererClient implementation. | 28 // ContentRendererClient implementation. |
| 29 virtual void RenderThreadStarted() OVERRIDE; | 29 virtual void RenderThreadStarted() OVERRIDE; |
| 30 virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; | 30 virtual void RenderViewCreated(content::RenderView* render_view) OVERRIDE; |
| 31 virtual std::string GetDefaultEncoding() OVERRIDE; | 31 virtual std::string GetDefaultEncoding() OVERRIDE; |
| 32 virtual bool HasErrorPage(int http_status_code, | 32 virtual bool HasErrorPage(int http_status_code, |
| 33 std::string* error_domain) OVERRIDE; | 33 std::string* error_domain) OVERRIDE; |
| 34 virtual void GetNavigationErrorStrings( | 34 virtual void GetNavigationErrorStrings( |
| 35 WebKit::WebFrame* frame, | 35 WebKit::WebFrame* frame, |
| 36 const WebKit::WebURLRequest& failed_request, | 36 const WebKit::WebURLRequest& failed_request, |
| 37 const WebKit::WebURLError& error, | 37 const WebKit::WebURLError& error, |
| 38 std::string* error_html, | 38 std::string* error_html, |
| 39 string16* error_description) OVERRIDE; | 39 string16* error_description) OVERRIDE; |
| 40 virtual unsigned long long VisitedLinkHash(const char* canonical_url, | 40 virtual unsigned long long VisitedLinkHash(const char* canonical_url, |
| 41 size_t length) OVERRIDE; | 41 size_t length) OVERRIDE; |
| 42 virtual bool IsLinkVisited(unsigned long long link_hash) OVERRIDE; | 42 virtual bool IsLinkVisited(unsigned long long link_hash) OVERRIDE; |
| 43 virtual void PrefetchHostName(const char* hostname, size_t length) OVERRIDE; | 43 virtual void PrefetchHostName(const char* hostname, size_t length) OVERRIDE; |
| 44 virtual MessageLoop* OverrideCompositorMessageLoop() const OVERRIDE; | 44 virtual base::MessageLoop* OverrideCompositorMessageLoop() const OVERRIDE; |
| 45 virtual bool ShouldCreateCompositorInputHandler() const OVERRIDE; | 45 virtual bool ShouldCreateCompositorInputHandler() const OVERRIDE; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 scoped_ptr<AwRenderProcessObserver> aw_render_process_observer_; | 48 scoped_ptr<AwRenderProcessObserver> aw_render_process_observer_; |
| 49 scoped_ptr<components::VisitedLinkSlave> visited_link_slave_; | 49 scoped_ptr<components::VisitedLinkSlave> visited_link_slave_; |
| 50 CompositorMessageLoopGetter* compositor_message_loop_getter_; | 50 CompositorMessageLoopGetter* compositor_message_loop_getter_; |
| 51 bool should_create_compositor_input_handler_; | 51 bool should_create_compositor_input_handler_; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace android_webview | 54 } // namespace android_webview |
| 55 | 55 |
| 56 #endif // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ | 56 #endif // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ |
| OLD | NEW |