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