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 <memory> |
9 | 9 #include <string> |
10 #include <stddef.h> | |
11 | 10 |
12 #include "android_webview/renderer/aw_render_process_observer.h" | 11 #include "android_webview/renderer/aw_render_process_observer.h" |
13 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/weak_ptr.h" |
| 14 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h" |
| 15 #include "content/public/renderer/content_renderer_client.h" |
14 | 16 |
15 namespace visitedlink { | 17 namespace visitedlink { |
16 class VisitedLinkSlave; | 18 class VisitedLinkSlave; |
17 } | 19 } |
18 | 20 |
19 namespace android_webview { | 21 namespace android_webview { |
20 | 22 |
21 class AwContentRendererClient : public content::ContentRendererClient { | 23 class AwContentRendererClient : public content::ContentRendererClient { |
22 public: | 24 public: |
23 AwContentRendererClient(); | 25 AwContentRendererClient(); |
(...skipping 21 matching lines...) Expand all Loading... |
45 const blink::WebURLRequest& request, | 47 const blink::WebURLRequest& request, |
46 blink::WebNavigationType type, | 48 blink::WebNavigationType type, |
47 blink::WebNavigationPolicy default_policy, | 49 blink::WebNavigationPolicy default_policy, |
48 bool is_redirect) override; | 50 bool is_redirect) override; |
49 bool ShouldUseMediaPlayerForURL(const GURL& url) override; | 51 bool ShouldUseMediaPlayerForURL(const GURL& url) override; |
50 bool ShouldOverridePageVisibilityState( | 52 bool ShouldOverridePageVisibilityState( |
51 const content::RenderFrame* render_frame, | 53 const content::RenderFrame* render_frame, |
52 blink::WebPageVisibilityState* override_state) override; | 54 blink::WebPageVisibilityState* override_state) override; |
53 | 55 |
54 private: | 56 private: |
| 57 void OnWebRestrictionsDataReceived( |
| 58 const std::string& url, |
| 59 content::RenderFrame* render_frame, |
| 60 const blink::WebURLError& error, |
| 61 web_restrictions::mojom::ClientResultPtr result); |
| 62 |
55 std::unique_ptr<AwRenderProcessObserver> aw_render_process_observer_; | 63 std::unique_ptr<AwRenderProcessObserver> aw_render_process_observer_; |
56 std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_; | 64 std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_; |
| 65 web_restrictions::mojom::WebRestrictionsPtr web_restrictions_service_; |
57 const bool disable_page_visibility_; | 66 const bool disable_page_visibility_; |
| 67 |
| 68 base::WeakPtrFactory<AwContentRendererClient> weak_ptr_factory_; |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(AwContentRendererClient); |
58 }; | 71 }; |
59 | 72 |
60 } // namespace android_webview | 73 } // namespace android_webview |
61 | 74 |
62 #endif // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ | 75 #endif // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_RENDERER_CLIENT_H_ |
OLD | NEW |