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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "android_webview/common/aw_resource.h" | 9 #include "android_webview/common/aw_resource.h" |
10 #include "android_webview/common/aw_switches.h" | 10 #include "android_webview/common/aw_switches.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 RenderThread::Get()->Send(new AwViewHostMsg_ShouldOverrideUrlLoading( | 142 RenderThread::Get()->Send(new AwViewHostMsg_ShouldOverrideUrlLoading( |
143 render_frame_id, url, has_user_gesture, is_redirect, is_main_frame, | 143 render_frame_id, url, has_user_gesture, is_redirect, is_main_frame, |
144 &ignore_navigation)); | 144 &ignore_navigation)); |
145 return ignore_navigation; | 145 return ignore_navigation; |
146 } | 146 } |
147 | 147 |
148 void AwContentRendererClient::RenderFrameCreated( | 148 void AwContentRendererClient::RenderFrameCreated( |
149 content::RenderFrame* render_frame) { | 149 content::RenderFrame* render_frame) { |
150 new AwContentSettingsClient(render_frame); | 150 new AwContentSettingsClient(render_frame); |
151 new PrintRenderFrameObserver(render_frame); | 151 new PrintRenderFrameObserver(render_frame); |
| 152 new printing::PrintWebViewHelper( |
| 153 render_frame, base::MakeUnique<AwPrintWebViewHelperDelegate>()); |
152 new AwRenderFrameExt(render_frame); | 154 new AwRenderFrameExt(render_frame); |
153 | 155 |
154 // TODO(jam): when the frame tree moves into content and parent() works at | 156 // TODO(jam): when the frame tree moves into content and parent() works at |
155 // RenderFrame construction, simplify this by just checking parent(). | 157 // RenderFrame construction, simplify this by just checking parent(). |
156 content::RenderFrame* parent_frame = | 158 content::RenderFrame* parent_frame = |
157 render_frame->GetRenderView()->GetMainRenderFrame(); | 159 render_frame->GetRenderView()->GetMainRenderFrame(); |
158 if (parent_frame && parent_frame != render_frame) { | 160 if (parent_frame && parent_frame != render_frame) { |
159 // Avoid any race conditions from having the browser's UI thread tell the IO | 161 // Avoid any race conditions from having the browser's UI thread tell the IO |
160 // thread that a subframe was created. | 162 // thread that a subframe was created. |
161 RenderThread::Get()->Send(new AwViewHostMsg_SubFrameCreated( | 163 RenderThread::Get()->Send(new AwViewHostMsg_SubFrameCreated( |
162 parent_frame->GetRoutingID(), render_frame->GetRoutingID())); | 164 parent_frame->GetRoutingID(), render_frame->GetRoutingID())); |
163 } | 165 } |
164 | 166 |
165 // TODO(sgurun) do not create a password autofill agent (change | 167 // TODO(sgurun) do not create a password autofill agent (change |
166 // autofill agent to store a weakptr). | 168 // autofill agent to store a weakptr). |
167 autofill::PasswordAutofillAgent* password_autofill_agent = | 169 autofill::PasswordAutofillAgent* password_autofill_agent = |
168 new autofill::PasswordAutofillAgent(render_frame); | 170 new autofill::PasswordAutofillAgent(render_frame); |
169 new autofill::AutofillAgent(render_frame, password_autofill_agent, NULL); | 171 new autofill::AutofillAgent(render_frame, password_autofill_agent, NULL); |
170 } | 172 } |
171 | 173 |
172 void AwContentRendererClient::RenderViewCreated( | 174 void AwContentRendererClient::RenderViewCreated( |
173 content::RenderView* render_view) { | 175 content::RenderView* render_view) { |
174 AwRenderViewExt::RenderViewCreated(render_view); | 176 AwRenderViewExt::RenderViewCreated(render_view); |
175 | 177 |
176 new printing::PrintWebViewHelper( | |
177 render_view, std::unique_ptr<printing::PrintWebViewHelper::Delegate>( | |
178 new AwPrintWebViewHelperDelegate())); | |
179 | |
180 #if BUILDFLAG(ENABLE_SPELLCHECK) | 178 #if BUILDFLAG(ENABLE_SPELLCHECK) |
181 new SpellCheckProvider(render_view, spellcheck_.get()); | 179 new SpellCheckProvider(render_view, spellcheck_.get()); |
182 #endif | 180 #endif |
183 } | 181 } |
184 | 182 |
185 bool AwContentRendererClient::HasErrorPage(int http_status_code, | 183 bool AwContentRendererClient::HasErrorPage(int http_status_code, |
186 std::string* error_domain) { | 184 std::string* error_domain) { |
187 return http_status_code >= 400; | 185 return http_status_code >= 400; |
188 } | 186 } |
189 | 187 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 for (auto* extension : kMediaPlayerExtensions) { | 275 for (auto* extension : kMediaPlayerExtensions) { |
278 if (base::EndsWith(url.path(), extension, | 276 if (base::EndsWith(url.path(), extension, |
279 base::CompareCase::INSENSITIVE_ASCII)) { | 277 base::CompareCase::INSENSITIVE_ASCII)) { |
280 return true; | 278 return true; |
281 } | 279 } |
282 } | 280 } |
283 return false; | 281 return false; |
284 } | 282 } |
285 | 283 |
286 } // namespace android_webview | 284 } // namespace android_webview |
OLD | NEW |