summaryrefslogtreecommitdiffstats
path: root/components/content_settings
diff options
context:
space:
mode:
authorvabr <vabr@chromium.org>2015-04-10 09:24:45 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-10 16:25:27 +0000
commitfc325fa0fbd5ad4e45791376c1a85e8781a89d27 (patch)
treee83e8feac3668db7cd6afb00b381f3ec3b2aba60 /components/content_settings
parent7d6a04929fbc69cd9287cc19a365789a42e0e12b (diff)
downloadchromium_src-fc325fa0fbd5ad4e45791376c1a85e8781a89d27.zip
chromium_src-fc325fa0fbd5ad4e45791376c1a85e8781a89d27.tar.gz
chromium_src-fc325fa0fbd5ad4e45791376c1a85e8781a89d27.tar.bz2
Make chrome/renderer/content_settings_observer.cc depend on //components/contents_settings for IPC
In preparation for moving chrome/renderer/content_settings_observer.cc into //components/contents_settings, this CL moves all IPC messages used in that file to a separate IPC declaration header in //components/contents_settings. The main parts of the change: * separating messages from chrome/common/render_messages.h to newly created components/content_settings/content/common/content_settings_messages.h * adding the support files in components/content_settings/content/common/ * extending the filter in chrome/browser/renderer_host/chrome_render_message_filter.cc to catch content settings IPC * and, of course, removing #include "chrome/common/render_messages.h" from content_settings_observer.cc The rest is mostly adding #includes and mechanical changes. BUG=384874,387075 Review URL: https://codereview.chromium.org/798923003 Cr-Commit-Position: refs/heads/master@{#324644}
Diffstat (limited to 'components/content_settings')
-rw-r--r--components/content_settings/DEPS5
-rw-r--r--components/content_settings/content/DEPS4
-rw-r--r--components/content_settings/content/common/BUILD.gn19
-rw-r--r--components/content_settings/content/common/DEPS3
-rw-r--r--components/content_settings/content/common/OWNERS14
-rw-r--r--components/content_settings/content/common/content_settings_message_generator.cc33
-rw-r--r--components/content_settings/content/common/content_settings_message_generator.h7
-rw-r--r--components/content_settings/content/common/content_settings_messages.h94
8 files changed, 179 insertions, 0 deletions
diff --git a/components/content_settings/DEPS b/components/content_settings/DEPS
new file mode 100644
index 0000000..df72508
--- /dev/null
+++ b/components/content_settings/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+ # Content settings is a layered component; subdirectories must explicitly
+ # introduce the ability to use the content layer as appropriate.
+ "-components/content_settings/content",
+]
diff --git a/components/content_settings/content/DEPS b/components/content_settings/content/DEPS
new file mode 100644
index 0000000..09645ae
--- /dev/null
+++ b/components/content_settings/content/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+ "+components/content_settings/content/common",
+ "+ipc",
+]
diff --git a/components/content_settings/content/common/BUILD.gn b/components/content_settings/content/common/BUILD.gn
new file mode 100644
index 0000000..5da2f62
--- /dev/null
+++ b/components/content_settings/content/common/BUILD.gn
@@ -0,0 +1,19 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+source_set("common") {
+ sources = [
+ "content_settings_message_generator.cc",
+ "content_settings_message_generator.h",
+ "content_settings_messages.h",
+ ]
+
+ deps = [
+ "//base",
+ "//components/content_settings/core/common",
+ "//content/public/common",
+ "//ipc",
+ "//url",
+ ]
+}
diff --git a/components/content_settings/content/common/DEPS b/components/content_settings/content/common/DEPS
new file mode 100644
index 0000000..d5923ee
--- /dev/null
+++ b/components/content_settings/content/common/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+content/public/common",
+]
diff --git a/components/content_settings/content/common/OWNERS b/components/content_settings/content/common/OWNERS
new file mode 100644
index 0000000..98c0978
--- /dev/null
+++ b/components/content_settings/content/common/OWNERS
@@ -0,0 +1,14 @@
+# Changes to IPC messages require a security review to avoid introducing
+# new sandbox escapes.
+per-file *_messages*.h=set noparent
+per-file *_messages*.h=dcheng@chromium.org
+per-file *_messages*.h=inferno@chromium.org
+per-file *_messages*.h=jln@chromium.org
+per-file *_messages*.h=jorgelo@chromium.org
+per-file *_messages*.h=jschuh@chromium.org
+per-file *_messages*.h=kenrb@chromium.org
+per-file *_messages*.h=mkwst@chromium.org
+per-file *_messages*.h=nasko@chromium.org
+per-file *_messages*.h=palmer@chromium.org
+per-file *_messages*.h=tsepez@chromium.org
+per-file *_messages*.h=wfh@chromium.org
diff --git a/components/content_settings/content/common/content_settings_message_generator.cc b/components/content_settings/content/common/content_settings_message_generator.cc
new file mode 100644
index 0000000..7e00666
--- /dev/null
+++ b/components/content_settings/content/common/content_settings_message_generator.cc
@@ -0,0 +1,33 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Get basic type definitions.
+#define IPC_MESSAGE_IMPL
+#include "components/content_settings/content/common/content_settings_message_generator.h"
+
+// Generate constructors.
+#include "ipc/struct_constructor_macros.h"
+#include "components/content_settings/content/common/content_settings_message_generator.h"
+
+// Generate destructors.
+#include "ipc/struct_destructor_macros.h"
+#include "components/content_settings/content/common/content_settings_message_generator.h"
+
+// Generate param traits write methods.
+#include "ipc/param_traits_write_macros.h"
+namespace IPC {
+#include "components/content_settings/content/common/content_settings_message_generator.h"
+} // namespace IPC
+
+// Generate param traits read methods.
+#include "ipc/param_traits_read_macros.h"
+namespace IPC {
+#include "components/content_settings/content/common/content_settings_message_generator.h"
+} // namespace IPC
+
+// Generate param traits log methods.
+#include "ipc/param_traits_log_macros.h"
+namespace IPC {
+#include "components/content_settings/content/common/content_settings_message_generator.h"
+} // namespace IPC
diff --git a/components/content_settings/content/common/content_settings_message_generator.h b/components/content_settings/content/common/content_settings_message_generator.h
new file mode 100644
index 0000000..322fbae
--- /dev/null
+++ b/components/content_settings/content/common/content_settings_message_generator.h
@@ -0,0 +1,7 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Multiply-included file, hence no include guard.
+
+#include "components/content_settings/content/common/content_settings_messages.h"
diff --git a/components/content_settings/content/common/content_settings_messages.h b/components/content_settings/content/common/content_settings_messages.h
new file mode 100644
index 0000000..82fee04
--- /dev/null
+++ b/components/content_settings/content/common/content_settings_messages.h
@@ -0,0 +1,94 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Multiply-included file, no traditional include guard.
+#include "base/strings/string16.h"
+#include "components/content_settings/core/common/content_settings_types.h"
+#include "content/public/common/common_param_traits.h"
+#include "content/public/common/common_param_traits_macros.h"
+#include "ipc/ipc_message_macros.h"
+#include "url/gurl.h"
+
+#define IPC_MESSAGE_START ContentSettingsMsgStart
+
+IPC_ENUM_TRAITS_MAX_VALUE(ContentSettingsType, CONTENT_SETTINGS_NUM_TYPES - 1)
+
+//-----------------------------------------------------------------------------
+// These are messages sent from the browser to the renderer process.
+
+// Sent in response to ViewHostMsg_DidBlockDisplayingInsecureContent.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowDisplayingInsecureContent,
+ bool /* allowed */)
+
+// Sent in response to ViewHostMsg_DidBlockRunningInsecureContent.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowRunningInsecureContent,
+ bool /* allowed */)
+
+IPC_MESSAGE_ROUTED0(ChromeViewMsg_ReloadFrame)
+
+// Tells the renderer whether or not a file system access has been allowed.
+IPC_MESSAGE_ROUTED2(ChromeViewMsg_RequestFileSystemAccessAsyncResponse,
+ int /* request_id */,
+ bool /* allowed */)
+
+// Tells the renderer that the NPAPI cannot be used. For example Ash on windows.
+IPC_MESSAGE_ROUTED0(ChromeViewMsg_NPAPINotSupported)
+
+// Tells the render frame to load all blocked plugins with the given identifier.
+IPC_MESSAGE_ROUTED1(ChromeViewMsg_LoadBlockedPlugins,
+ std::string /* identifier */)
+
+// JavaScript related messages -----------------------------------------------
+
+// Tells the frame it is displaying an interstitial page.
+IPC_MESSAGE_ROUTED0(ChromeViewMsg_SetAsInterstitial)
+
+//-----------------------------------------------------------------------------
+// These are messages sent from the renderer to the browser process.
+
+// Tells the browser that content in the current page was blocked due to the
+// user's content settings.
+IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_ContentBlocked,
+ ContentSettingsType /* type of blocked content */,
+ base::string16 /* details on blocked content */)
+
+// Sent by the renderer process to check whether access to web databases is
+// granted by content settings.
+IPC_SYNC_MESSAGE_CONTROL5_1(ChromeViewHostMsg_AllowDatabase,
+ int /* render_frame_id */,
+ GURL /* origin_url */,
+ GURL /* top origin url */,
+ base::string16 /* database name */,
+ base::string16 /* database display name */,
+ bool /* allowed */)
+
+// Sent by the renderer process to check whether access to DOM Storage is
+// granted by content settings.
+IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_AllowDOMStorage,
+ int /* render_frame_id */,
+ GURL /* origin_url */,
+ GURL /* top origin url */,
+ bool /* if true local storage, otherwise session */,
+ bool /* allowed */)
+
+// Sent by the renderer process to check whether access to FileSystem is
+// granted by content settings.
+IPC_MESSAGE_CONTROL4(ChromeViewHostMsg_RequestFileSystemAccessAsync,
+ int /* render_frame_id */,
+ int /* request_id */,
+ GURL /* origin_url */,
+ GURL /* top origin url */)
+
+// Sent by the renderer process to check whether access to Indexed DBis
+// granted by content settings.
+IPC_SYNC_MESSAGE_CONTROL4_1(ChromeViewHostMsg_AllowIndexedDB,
+ int /* render_frame_id */,
+ GURL /* origin_url */,
+ GURL /* top origin url */,
+ base::string16 /* database name */,
+ bool /* allowed */)
+
+// Sent when the renderer was prevented from displaying insecure content in
+// a secure page by a security policy. The page may appear incomplete.
+IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_DidBlockDisplayingInsecureContent)