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 #include "android_webview/renderer/aw_content_renderer_client.h" | 5 #include "android_webview/renderer/aw_content_renderer_client.h" |
6 | 6 |
7 #include "android_webview/common/aw_resource.h" | 7 #include "android_webview/common/aw_resource.h" |
8 #include "android_webview/common/render_view_messages.h" | 8 #include "android_webview/common/render_view_messages.h" |
9 #include "android_webview/common/url_constants.h" | 9 #include "android_webview/common/url_constants.h" |
10 #include "android_webview/renderer/aw_key_systems.h" | 10 #include "android_webview/renderer/aw_key_systems.h" |
11 #include "android_webview/renderer/aw_permission_client.h" | 11 #include "android_webview/renderer/aw_permission_client.h" |
| 12 #include "android_webview/renderer/aw_print_web_view_helper_delegate.h" |
12 #include "android_webview/renderer/aw_render_frame_ext.h" | 13 #include "android_webview/renderer/aw_render_frame_ext.h" |
13 #include "android_webview/renderer/aw_render_view_ext.h" | 14 #include "android_webview/renderer/aw_render_view_ext.h" |
14 #include "android_webview/renderer/print_render_frame_observer.h" | 15 #include "android_webview/renderer/print_render_frame_observer.h" |
15 #include "android_webview/renderer/print_web_view_helper.h" | |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "components/autofill/content/renderer/autofill_agent.h" | 18 #include "components/autofill/content/renderer/autofill_agent.h" |
19 #include "components/autofill/content/renderer/password_autofill_agent.h" | 19 #include "components/autofill/content/renderer/password_autofill_agent.h" |
| 20 #include "components/printing/renderer/print_web_view_helper.h" |
20 #include "components/visitedlink/renderer/visitedlink_slave.h" | 21 #include "components/visitedlink/renderer/visitedlink_slave.h" |
21 #include "content/public/common/url_constants.h" | 22 #include "content/public/common/url_constants.h" |
22 #include "content/public/renderer/document_state.h" | 23 #include "content/public/renderer/document_state.h" |
23 #include "content/public/renderer/navigation_state.h" | 24 #include "content/public/renderer/navigation_state.h" |
24 #include "content/public/renderer/render_frame.h" | 25 #include "content/public/renderer/render_frame.h" |
25 #include "content/public/renderer/render_thread.h" | 26 #include "content/public/renderer/render_thread.h" |
26 #include "content/public/renderer/render_view.h" | 27 #include "content/public/renderer/render_view.h" |
27 #include "net/base/escape.h" | 28 #include "net/base/escape.h" |
28 #include "net/base/net_errors.h" | 29 #include "net/base/net_errors.h" |
29 #include "third_party/WebKit/public/platform/WebString.h" | 30 #include "third_party/WebKit/public/platform/WebString.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // autofill agent to store a weakptr). | 139 // autofill agent to store a weakptr). |
139 autofill::PasswordAutofillAgent* password_autofill_agent = | 140 autofill::PasswordAutofillAgent* password_autofill_agent = |
140 new autofill::PasswordAutofillAgent(render_frame); | 141 new autofill::PasswordAutofillAgent(render_frame); |
141 new autofill::AutofillAgent(render_frame, password_autofill_agent, NULL); | 142 new autofill::AutofillAgent(render_frame, password_autofill_agent, NULL); |
142 } | 143 } |
143 | 144 |
144 void AwContentRendererClient::RenderViewCreated( | 145 void AwContentRendererClient::RenderViewCreated( |
145 content::RenderView* render_view) { | 146 content::RenderView* render_view) { |
146 AwRenderViewExt::RenderViewCreated(render_view); | 147 AwRenderViewExt::RenderViewCreated(render_view); |
147 | 148 |
148 new printing::PrintWebViewHelper(render_view); | 149 new printing::PrintWebViewHelper( |
| 150 render_view, |
| 151 scoped_ptr<printing::PrintWebViewHelper::Delegate>( |
| 152 new AwPrintWebViewHelperDelegate())); |
149 } | 153 } |
150 | 154 |
151 bool AwContentRendererClient::HasErrorPage(int http_status_code, | 155 bool AwContentRendererClient::HasErrorPage(int http_status_code, |
152 std::string* error_domain) { | 156 std::string* error_domain) { |
153 return http_status_code >= 400; | 157 return http_status_code >= 400; |
154 } | 158 } |
155 | 159 |
156 void AwContentRendererClient::GetNavigationErrorStrings( | 160 void AwContentRendererClient::GetNavigationErrorStrings( |
157 content::RenderView* /* render_view */, | 161 content::RenderView* /* render_view */, |
158 blink::WebFrame* /* frame */, | 162 blink::WebFrame* /* frame */, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 204 |
201 bool AwContentRendererClient::ShouldOverridePageVisibilityState( | 205 bool AwContentRendererClient::ShouldOverridePageVisibilityState( |
202 const content::RenderFrame* render_frame, | 206 const content::RenderFrame* render_frame, |
203 blink::WebPageVisibilityState* override_state) { | 207 blink::WebPageVisibilityState* override_state) { |
204 // webview is always visible due to rendering requirements. | 208 // webview is always visible due to rendering requirements. |
205 *override_state = blink::WebPageVisibilityStateVisible; | 209 *override_state = blink::WebPageVisibilityStateVisible; |
206 return true; | 210 return true; |
207 } | 211 } |
208 | 212 |
209 } // namespace android_webview | 213 } // namespace android_webview |
OLD | NEW |