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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // thread that a subframe was created. | 163 // thread that a subframe was created. |
164 RenderThread::Get()->Send(new AwViewHostMsg_SubFrameCreated( | 164 RenderThread::Get()->Send(new AwViewHostMsg_SubFrameCreated( |
165 parent_frame->GetRoutingID(), render_frame->GetRoutingID())); | 165 parent_frame->GetRoutingID(), render_frame->GetRoutingID())); |
166 } | 166 } |
167 | 167 |
168 // TODO(sgurun) do not create a password autofill agent (change | 168 // TODO(sgurun) do not create a password autofill agent (change |
169 // autofill agent to store a weakptr). | 169 // autofill agent to store a weakptr). |
170 autofill::PasswordAutofillAgent* password_autofill_agent = | 170 autofill::PasswordAutofillAgent* password_autofill_agent = |
171 new autofill::PasswordAutofillAgent(render_frame); | 171 new autofill::PasswordAutofillAgent(render_frame); |
172 new autofill::AutofillAgent(render_frame, password_autofill_agent, NULL); | 172 new autofill::AutofillAgent(render_frame, password_autofill_agent, NULL); |
| 173 |
| 174 #if BUILDFLAG(ENABLE_SPELLCHECK) |
| 175 new SpellCheckProvider(render_frame, spellcheck_.get()); |
| 176 #endif |
173 } | 177 } |
174 | 178 |
175 void AwContentRendererClient::RenderViewCreated( | 179 void AwContentRendererClient::RenderViewCreated( |
176 content::RenderView* render_view) { | 180 content::RenderView* render_view) { |
177 AwRenderViewExt::RenderViewCreated(render_view); | 181 AwRenderViewExt::RenderViewCreated(render_view); |
178 | 182 |
179 #if BUILDFLAG(ENABLE_SPELLCHECK) | 183 #if BUILDFLAG(ENABLE_SPELLCHECK) |
180 new SpellCheckProvider(render_view, spellcheck_.get()); | 184 // This is a workaround keeping the behavior that, the Blink side spellcheck |
| 185 // enabled state is initialized on RenderView creation. |
| 186 // TODO(xiaochengh): Design better way to sync between Chrome-side and |
| 187 // Blink-side spellcheck enabled states. See crbug.com/710097. |
| 188 if (SpellCheckProvider* provider = |
| 189 SpellCheckProvider::Get(render_view->GetMainRenderFrame())) |
| 190 provider->EnableSpellcheck(spellcheck_->IsSpellcheckEnabled()); |
181 #endif | 191 #endif |
182 } | 192 } |
183 | 193 |
184 bool AwContentRendererClient::HasErrorPage(int http_status_code, | 194 bool AwContentRendererClient::HasErrorPage(int http_status_code, |
185 std::string* error_domain) { | 195 std::string* error_domain) { |
186 return http_status_code >= 400; | 196 return http_status_code >= 400; |
187 } | 197 } |
188 | 198 |
189 void AwContentRendererClient::GetNavigationErrorStrings( | 199 void AwContentRendererClient::GetNavigationErrorStrings( |
190 content::RenderFrame* render_frame, | 200 content::RenderFrame* render_frame, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 for (auto* extension : kMediaPlayerExtensions) { | 306 for (auto* extension : kMediaPlayerExtensions) { |
297 if (base::EndsWith(url.path(), extension, | 307 if (base::EndsWith(url.path(), extension, |
298 base::CompareCase::INSENSITIVE_ASCII)) { | 308 base::CompareCase::INSENSITIVE_ASCII)) { |
299 return true; | 309 return true; |
300 } | 310 } |
301 } | 311 } |
302 return false; | 312 return false; |
303 } | 313 } |
304 | 314 |
305 } // namespace android_webview | 315 } // namespace android_webview |
OLD | NEW |