Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(988)

Side by Side Diff: android_webview/renderer/aw_content_renderer_client.cc

Issue 254763005: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial patches. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_frame_observer.h" 12 #include "android_webview/renderer/aw_render_frame_observer.h"
13 #include "android_webview/renderer/aw_render_view_ext.h" 13 #include "android_webview/renderer/aw_render_view_ext.h"
14 #include "android_webview/renderer/print_web_view_helper.h" 14 #include "android_webview/renderer/print_web_view_helper.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "components/autofill/content/renderer/autofill_agent.h" 17 #include "components/autofill/content/renderer/autofill_agent.h"
18 #include "components/autofill/content/renderer/password_autofill_agent.h" 18 #include "components/autofill/content/renderer/password_autofill_agent.h"
19 #include "components/visitedlink/renderer/visitedlink_slave.h" 19 #include "components/visitedlink/renderer/visitedlink_slave.h"
20 #include "content/public/common/url_constants.h" 20 #include "content/public/common/url_constants.h"
21 #include "content/public/renderer/document_state.h" 21 #include "content/public/renderer/document_state.h"
22 #include "content/public/renderer/navigation_state.h" 22 #include "content/public/renderer/navigation_state.h"
23 #include "content/public/renderer/render_frame.h" 23 #include "content/public/renderer/render_frame.h"
24 #include "content/public/renderer/render_thread.h" 24 #include "content/public/renderer/render_thread.h"
25 #include "content/public/renderer/render_view.h" 25 #include "content/public/renderer/render_view.h"
26 #include "net/base/escape.h" 26 #include "net/base/escape.h"
27 #include "net/base/net_errors.h" 27 #include "net/base/net_errors.h"
28 #include "net/base/url_constants.h"
28 #include "third_party/WebKit/public/platform/WebString.h" 29 #include "third_party/WebKit/public/platform/WebString.h"
29 #include "third_party/WebKit/public/platform/WebURL.h" 30 #include "third_party/WebKit/public/platform/WebURL.h"
30 #include "third_party/WebKit/public/platform/WebURLError.h" 31 #include "third_party/WebKit/public/platform/WebURLError.h"
31 #include "third_party/WebKit/public/platform/WebURLRequest.h" 32 #include "third_party/WebKit/public/platform/WebURLRequest.h"
32 #include "third_party/WebKit/public/web/WebFrame.h" 33 #include "third_party/WebKit/public/web/WebFrame.h"
33 #include "third_party/WebKit/public/web/WebNavigationType.h" 34 #include "third_party/WebKit/public/web/WebNavigationType.h"
34 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 35 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
35 #include "url/gurl.h" 36 #include "url/gurl.h"
36 37
37 using content::RenderThread; 38 using content::RenderThread;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 || type == blink::WebNavigationTypeBackForward; 90 || type == blink::WebNavigationTypeBackForward;
90 91
91 // Don't offer application-initiated navigations unless it's a redirect. 92 // Don't offer application-initiated navigations unless it's a redirect.
92 if (application_initiated && !is_redirect) 93 if (application_initiated && !is_redirect)
93 return false; 94 return false;
94 95
95 const GURL& gurl = request.url(); 96 const GURL& gurl = request.url();
96 // For HTTP schemes, only top-level navigations can be overridden. Similarly, 97 // For HTTP schemes, only top-level navigations can be overridden. Similarly,
97 // WebView Classic lets app override only top level about:blank navigations. 98 // WebView Classic lets app override only top level about:blank navigations.
98 // So we filter out non-top about:blank navigations here. 99 // So we filter out non-top about:blank navigations here.
99 if (frame->parent() && (gurl.SchemeIs(content::kHttpScheme) || 100 if (frame->parent() &&
100 gurl.SchemeIs(content::kHttpsScheme) || 101 (gurl.SchemeIs(net::kHttpScheme) || gurl.SchemeIs(net::kHttpsScheme) ||
101 gurl.SchemeIs(content::kAboutScheme))) 102 gurl.SchemeIs(content::kAboutScheme)))
102 return false; 103 return false;
103 104
104 // use NavigationInterception throttle to handle the call as that can 105 // use NavigationInterception throttle to handle the call as that can
105 // be deferred until after the java side has been constructed. 106 // be deferred until after the java side has been constructed.
106 if (opener_id != MSG_ROUTING_NONE) { 107 if (opener_id != MSG_ROUTING_NONE) {
107 return false; 108 return false;
108 } 109 }
109 110
110 bool ignore_navigation = false; 111 bool ignore_navigation = false;
111 base::string16 url = request.url().string(); 112 base::string16 url = request.url().string();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) { 194 bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) {
194 return visited_link_slave_->IsVisited(link_hash); 195 return visited_link_slave_->IsVisited(link_hash);
195 } 196 }
196 197
197 void AwContentRendererClient::AddKeySystems( 198 void AwContentRendererClient::AddKeySystems(
198 std::vector<content::KeySystemInfo>* key_systems) { 199 std::vector<content::KeySystemInfo>* key_systems) {
199 AwAddKeySystems(key_systems); 200 AwAddKeySystems(key_systems);
200 } 201 }
201 202
202 } // namespace android_webview 203 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698