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