Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h" | 33 #include "components/web_restrictions/interfaces/web_restrictions.mojom.h" |
| 34 #include "content/public/common/url_constants.h" | 34 #include "content/public/common/url_constants.h" |
| 35 #include "content/public/renderer/document_state.h" | 35 #include "content/public/renderer/document_state.h" |
| 36 #include "content/public/renderer/navigation_state.h" | 36 #include "content/public/renderer/navigation_state.h" |
| 37 #include "content/public/renderer/render_frame.h" | 37 #include "content/public/renderer/render_frame.h" |
| 38 #include "content/public/renderer/render_thread.h" | 38 #include "content/public/renderer/render_thread.h" |
| 39 #include "content/public/renderer/render_view.h" | 39 #include "content/public/renderer/render_view.h" |
| 40 #include "net/base/escape.h" | 40 #include "net/base/escape.h" |
| 41 #include "net/base/net_errors.h" | 41 #include "net/base/net_errors.h" |
| 42 #include "services/shell/public/cpp/interface_provider.h" | 42 #include "services/shell/public/cpp/interface_provider.h" |
| 43 #include "services/shell/public/cpp/interface_registry.h" | |
| 43 #include "third_party/WebKit/public/platform/WebString.h" | 44 #include "third_party/WebKit/public/platform/WebString.h" |
| 44 #include "third_party/WebKit/public/platform/WebURL.h" | 45 #include "third_party/WebKit/public/platform/WebURL.h" |
| 45 #include "third_party/WebKit/public/platform/WebURLError.h" | 46 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 46 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 47 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 47 #include "third_party/WebKit/public/web/WebFrame.h" | 48 #include "third_party/WebKit/public/web/WebFrame.h" |
| 48 #include "third_party/WebKit/public/web/WebNavigationType.h" | 49 #include "third_party/WebKit/public/web/WebNavigationType.h" |
| 49 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 50 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 50 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
| 51 #include "ui/base/resource/resource_bundle.h" | 52 #include "ui/base/resource/resource_bundle.h" |
| 52 #include "url/gurl.h" | 53 #include "url/gurl.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 64 AwContentRendererClient::AwContentRendererClient() {} | 65 AwContentRendererClient::AwContentRendererClient() {} |
| 65 | 66 |
| 66 AwContentRendererClient::~AwContentRendererClient() {} | 67 AwContentRendererClient::~AwContentRendererClient() {} |
| 67 | 68 |
| 68 void AwContentRendererClient::RenderThreadStarted() { | 69 void AwContentRendererClient::RenderThreadStarted() { |
| 69 RenderThread* thread = RenderThread::Get(); | 70 RenderThread* thread = RenderThread::Get(); |
| 70 aw_render_thread_observer_.reset(new AwRenderThreadObserver); | 71 aw_render_thread_observer_.reset(new AwRenderThreadObserver); |
| 71 thread->AddObserver(aw_render_thread_observer_.get()); | 72 thread->AddObserver(aw_render_thread_observer_.get()); |
| 72 | 73 |
| 73 visited_link_slave_.reset(new visitedlink::VisitedLinkSlave); | 74 visited_link_slave_.reset(new visitedlink::VisitedLinkSlave); |
| 74 thread->AddObserver(visited_link_slave_.get()); | 75 thread->GetInterfaceRegistry()->AddInterface( |
| 76 base::Bind(&visitedlink::VisitedLinkSlave::Bind, | |
| 77 base::Unretained(visited_link_slave_.get()))); | |
|
dcheng
2016/09/20 22:29:27
I am still uncomfortable that Mojo is encouraging
Sam McNally
2016/09/21 02:38:14
Done.
| |
| 75 | 78 |
| 76 blink::WebString content_scheme(base::ASCIIToUTF16(url::kContentScheme)); | 79 blink::WebString content_scheme(base::ASCIIToUTF16(url::kContentScheme)); |
| 77 blink::WebSecurityPolicy::registerURLSchemeAsLocal(content_scheme); | 80 blink::WebSecurityPolicy::registerURLSchemeAsLocal(content_scheme); |
| 78 | 81 |
| 79 blink::WebString aw_scheme( | 82 blink::WebString aw_scheme( |
| 80 base::ASCIIToUTF16(android_webview::kAndroidWebViewVideoPosterScheme)); | 83 base::ASCIIToUTF16(android_webview::kAndroidWebViewVideoPosterScheme)); |
| 81 blink::WebSecurityPolicy::registerURLSchemeAsSecure(aw_scheme); | 84 blink::WebSecurityPolicy::registerURLSchemeAsSecure(aw_scheme); |
| 82 | 85 |
| 83 #if defined(ENABLE_SPELLCHECK) | 86 #if defined(ENABLE_SPELLCHECK) |
| 84 if (!spellcheck_) { | 87 if (!spellcheck_) { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 for (auto* extension : kMediaPlayerExtensions) { | 279 for (auto* extension : kMediaPlayerExtensions) { |
| 277 if (base::EndsWith(url.path(), extension, | 280 if (base::EndsWith(url.path(), extension, |
| 278 base::CompareCase::INSENSITIVE_ASCII)) { | 281 base::CompareCase::INSENSITIVE_ASCII)) { |
| 279 return true; | 282 return true; |
| 280 } | 283 } |
| 281 } | 284 } |
| 282 return false; | 285 return false; |
| 283 } | 286 } |
| 284 | 287 |
| 285 } // namespace android_webview | 288 } // namespace android_webview |
| OLD | NEW |