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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "android_webview/renderer/aw_render_thread_observer.h" | 11 #include "android_webview/renderer/aw_render_thread_observer.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "components/safe_browsing/common/safe_browsing.mojom.h" |
14 #include "components/spellcheck/spellcheck_build_features.h" | 15 #include "components/spellcheck/spellcheck_build_features.h" |
15 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h" | 16 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h" |
16 #include "content/public/renderer/content_renderer_client.h" | 17 #include "content/public/renderer/content_renderer_client.h" |
17 | 18 |
18 #if BUILDFLAG(ENABLE_SPELLCHECK) | 19 #if BUILDFLAG(ENABLE_SPELLCHECK) |
19 class SpellCheck; | 20 class SpellCheck; |
20 #endif | 21 #endif |
21 | 22 |
22 namespace visitedlink { | 23 namespace visitedlink { |
23 class VisitedLinkSlave; | 24 class VisitedLinkSlave; |
(...skipping 15 matching lines...) Expand all Loading... |
39 const blink::WebURLRequest& failed_request, | 40 const blink::WebURLRequest& failed_request, |
40 const blink::WebURLError& error, | 41 const blink::WebURLError& error, |
41 std::string* error_html, | 42 std::string* error_html, |
42 base::string16* error_description) override; | 43 base::string16* error_description) override; |
43 unsigned long long VisitedLinkHash(const char* canonical_url, | 44 unsigned long long VisitedLinkHash(const char* canonical_url, |
44 size_t length) override; | 45 size_t length) override; |
45 bool IsLinkVisited(unsigned long long link_hash) override; | 46 bool IsLinkVisited(unsigned long long link_hash) override; |
46 void AddSupportedKeySystems( | 47 void AddSupportedKeySystems( |
47 std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) | 48 std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) |
48 override; | 49 override; |
| 50 std::unique_ptr<blink::WebSocketHandshakeThrottle> |
| 51 CreateWebSocketHandshakeThrottle() override; |
49 | 52 |
50 bool HandleNavigation(content::RenderFrame* render_frame, | 53 bool HandleNavigation(content::RenderFrame* render_frame, |
51 bool is_content_initiated, | 54 bool is_content_initiated, |
52 bool render_view_was_created_by_renderer, | 55 bool render_view_was_created_by_renderer, |
53 blink::WebFrame* frame, | 56 blink::WebFrame* frame, |
54 const blink::WebURLRequest& request, | 57 const blink::WebURLRequest& request, |
55 blink::WebNavigationType type, | 58 blink::WebNavigationType type, |
56 blink::WebNavigationPolicy default_policy, | 59 blink::WebNavigationPolicy default_policy, |
57 bool is_redirect) override; | 60 bool is_redirect) override; |
58 bool ShouldUseMediaPlayerForURL(const GURL& url) override; | 61 bool ShouldUseMediaPlayerForURL(const GURL& url) override; |
59 | 62 |
60 private: | 63 private: |
| 64 // Returns |true| if we should use the SafeBrowsing mojo service. Initialises |
| 65 // |safe_browsing_| on the first call as a side-effect. |
| 66 bool UsingSafeBrowsingMojoService(); |
| 67 |
61 std::unique_ptr<AwRenderThreadObserver> aw_render_thread_observer_; | 68 std::unique_ptr<AwRenderThreadObserver> aw_render_thread_observer_; |
62 std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_; | 69 std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_; |
63 web_restrictions::mojom::WebRestrictionsPtr web_restrictions_service_; | 70 web_restrictions::mojom::WebRestrictionsPtr web_restrictions_service_; |
| 71 safe_browsing::mojom::SafeBrowsingPtr safe_browsing_; |
64 | 72 |
65 #if BUILDFLAG(ENABLE_SPELLCHECK) | 73 #if BUILDFLAG(ENABLE_SPELLCHECK) |
66 std::unique_ptr<SpellCheck> spellcheck_; | 74 std::unique_ptr<SpellCheck> spellcheck_; |
67 #endif | 75 #endif |
68 | 76 |
69 DISALLOW_COPY_AND_ASSIGN(AwContentRendererClient); | 77 DISALLOW_COPY_AND_ASSIGN(AwContentRendererClient); |
70 }; | 78 }; |
71 | 79 |
72 } // namespace android_webview | 80 } // namespace android_webview |
73 | 81 |
74 #endif // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ | 82 #endif // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ |
OLD | NEW |