summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/chrome_render_process_observer.cc
diff options
context:
space:
mode:
authortedchoc@chromium.org <tedchoc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-04 01:13:29 +0000
committertedchoc@chromium.org <tedchoc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-04 01:13:29 +0000
commit3d831992ca2c2f394eea257e93ba177333398094 (patch)
treedfce9a899c9b38fb702f6badf42a075dc4e9f1ab /chrome/renderer/chrome_render_process_observer.cc
parent00a392b57c9a07c331cab0f67e863cf97efb0924 (diff)
downloadchromium_src-3d831992ca2c2f394eea257e93ba177333398094.zip
chromium_src-3d831992ca2c2f394eea257e93ba177333398094.tar.gz
chromium_src-3d831992ca2c2f394eea257e93ba177333398094.tar.bz2
Move chrome-native support to chrome/
Based on request in: https://chromiumcodereview.appspot.com/15675024 BUG=178915 Review URL: https://chromiumcodereview.appspot.com/17648003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210092 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/chrome_render_process_observer.cc')
-rw-r--r--chrome/renderer/chrome_render_process_observer.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc
index e55baee..b46dbac 100644
--- a/chrome/renderer/chrome_render_process_observer.cc
+++ b/chrome/renderer/chrome_render_process_observer.cc
@@ -19,6 +19,7 @@
#include "base/native_library.h"
#include "base/path_service.h"
#include "base/process_util.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/threading/platform_thread.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_paths.h"
@@ -27,6 +28,7 @@
#include "chrome/common/metrics/variations/variations_util.h"
#include "chrome/common/net/net_resource_provider.h"
#include "chrome/common/render_messages.h"
+#include "chrome/common/url_constants.h"
#include "chrome/renderer/chrome_content_renderer_client.h"
#include "chrome/renderer/content_settings_observer.h"
#include "chrome/renderer/extensions/extension_localization_peer.h"
@@ -46,6 +48,7 @@
#include "third_party/WebKit/public/web/WebFontCache.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
+#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "v8/include/v8.h"
@@ -57,6 +60,8 @@ using WebKit::WebCache;
using WebKit::WebCrossOriginPreflightResultCache;
using WebKit::WebFontCache;
using WebKit::WebRuntimeFeatures;
+using WebKit::WebSecurityPolicy;
+using WebKit::WebString;
using content::RenderThread;
namespace {
@@ -333,6 +338,21 @@ bool ChromeRenderProcessObserver::OnControlMessageReceived(
return handled;
}
+void ChromeRenderProcessObserver::WebKitInitialized() {
+ // chrome-native: is a scheme used for placeholder navigations that allow
+ // UIs to be drawn with platform native widgets instead of HTML. These pages
+ // should not be accessible, and should also be treated as empty documents
+ // that can commit synchronously. No code should be runnable in these pages,
+ // so it should not need to access anything nor should it allow javascript
+ // URLs since it should never be visible to the user.
+ WebString native_scheme(ASCIIToUTF16(chrome::kChromeNativeScheme));
+ WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(native_scheme);
+ WebSecurityPolicy::registerURLSchemeAsEmptyDocument(native_scheme);
+ WebSecurityPolicy::registerURLSchemeAsNoAccess(native_scheme);
+ WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs(
+ native_scheme);
+}
+
void ChromeRenderProcessObserver::OnSetIsIncognitoProcess(
bool is_incognito_process) {
is_incognito_process_ = is_incognito_process;