| 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_render_view_ext.h" | 12 #include "android_webview/renderer/aw_render_view_ext.h" |
| 13 #include "android_webview/renderer/print_web_view_helper.h" | 13 #include "android_webview/renderer/print_web_view_helper.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "components/autofill/content/renderer/autofill_agent.h" | 16 #include "components/autofill/content/renderer/autofill_agent.h" |
| 17 #include "components/autofill/content/renderer/password_autofill_agent.h" | 17 #include "components/autofill/content/renderer/password_autofill_agent.h" |
| 18 #include "components/visitedlink/renderer/visitedlink_slave.h" | 18 #include "components/visitedlink/renderer/visitedlink_slave.h" |
| 19 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
| 20 #include "content/public/renderer/document_state.h" | 20 #include "content/public/renderer/document_state.h" |
| 21 #include "content/public/renderer/navigation_state.h" | 21 #include "content/public/renderer/navigation_state.h" |
| 22 #include "content/public/renderer/render_frame.h" | 22 #include "content/public/renderer/render_frame.h" |
| 23 #include "content/public/renderer/render_thread.h" | 23 #include "content/public/renderer/render_thread.h" |
| 24 #include "content/public/renderer/render_view.h" |
| 24 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
| 25 #include "third_party/WebKit/public/platform/WebString.h" | 26 #include "third_party/WebKit/public/platform/WebString.h" |
| 26 #include "third_party/WebKit/public/platform/WebURL.h" | 27 #include "third_party/WebKit/public/platform/WebURL.h" |
| 27 #include "third_party/WebKit/public/platform/WebURLError.h" | 28 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 28 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 29 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 29 #include "third_party/WebKit/public/web/WebFrame.h" | 30 #include "third_party/WebKit/public/web/WebFrame.h" |
| 30 #include "third_party/WebKit/public/web/WebNavigationType.h" | 31 #include "third_party/WebKit/public/web/WebNavigationType.h" |
| 31 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 32 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 32 #include "url/gurl.h" | 33 #include "url/gurl.h" |
| 33 | 34 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 110 |
| 110 int render_frame_id = render_frame->GetRoutingID(); | 111 int render_frame_id = render_frame->GetRoutingID(); |
| 111 RenderThread::Get()->Send(new AwViewHostMsg_ShouldOverrideUrlLoading( | 112 RenderThread::Get()->Send(new AwViewHostMsg_ShouldOverrideUrlLoading( |
| 112 render_frame_id, url, &ignore_navigation)); | 113 render_frame_id, url, &ignore_navigation)); |
| 113 return ignore_navigation; | 114 return ignore_navigation; |
| 114 } | 115 } |
| 115 | 116 |
| 116 void AwContentRendererClient::RenderFrameCreated( | 117 void AwContentRendererClient::RenderFrameCreated( |
| 117 content::RenderFrame* render_frame) { | 118 content::RenderFrame* render_frame) { |
| 118 new AwPermissionClient(render_frame); | 119 new AwPermissionClient(render_frame); |
| 120 |
| 121 // TODO(jam): when a RenderFrame is per WebFrame, this can be simplified by |
| 122 // getting a RenderFrame's WebFrame and calling its parent() method. |
| 123 content::RenderFrame* parent_frame = |
| 124 render_frame->GetRenderView()->GetMainRenderFrame(); |
| 125 if (parent_frame && parent_frame != render_frame) { |
| 126 // Avoid any race conditions from having the browser's UI thread tell the IO |
| 127 // thread that a subframe was created. |
| 128 RenderThread::Get()->Send(new AwViewHostMsg_SubFrameCreated( |
| 129 parent_frame->GetRoutingID(), render_frame->GetRoutingID())); |
| 130 } |
| 119 } | 131 } |
| 120 | 132 |
| 121 void AwContentRendererClient::RenderViewCreated( | 133 void AwContentRendererClient::RenderViewCreated( |
| 122 content::RenderView* render_view) { | 134 content::RenderView* render_view) { |
| 123 AwRenderViewExt::RenderViewCreated(render_view); | 135 AwRenderViewExt::RenderViewCreated(render_view); |
| 124 | 136 |
| 125 new printing::PrintWebViewHelper(render_view); | 137 new printing::PrintWebViewHelper(render_view); |
| 126 // TODO(sgurun) do not create a password autofill agent (change | 138 // TODO(sgurun) do not create a password autofill agent (change |
| 127 // autofill agent to store a weakptr). | 139 // autofill agent to store a weakptr). |
| 128 autofill::PasswordAutofillAgent* password_autofill_agent = | 140 autofill::PasswordAutofillAgent* password_autofill_agent = |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) { | 190 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) { |
| 179 return visited_link_slave_->IsVisited(link_hash); | 191 return visited_link_slave_->IsVisited(link_hash); |
| 180 } | 192 } |
| 181 | 193 |
| 182 void AwContentRendererClient::AddKeySystems( | 194 void AwContentRendererClient::AddKeySystems( |
| 183 std::vector<content::KeySystemInfo>* key_systems) { | 195 std::vector<content::KeySystemInfo>* key_systems) { |
| 184 AwAddKeySystems(key_systems); | 196 AwAddKeySystems(key_systems); |
| 185 } | 197 } |
| 186 | 198 |
| 187 } // namespace android_webview | 199 } // namespace android_webview |
| OLD | NEW |