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}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 20d38e1..24abe29 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -86,6 +86,7 @@
     "//components/captive_portal",
     "//components/cloud_devices/common",
     "//components/component_updater",
+    "//components/content_settings/content/common",
     "//components/content_settings/core/browser",
     "//components/content_settings/core/common",
     "//components/crx_file",
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 364c7d52..cbb29ea 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -27,6 +27,7 @@
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/common/render_messages.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "components/content_settings/core/browser/content_settings_details.h"
 #include "components/content_settings/core/browser/content_settings_utils.h"
 #include "components/content_settings/core/browser/host_content_settings_map.h"
diff --git a/chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc b/chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc
index 8bf88d0..916dcd0 100644
--- a/chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc
+++ b/chrome/browser/guest_view/web_view/chrome_web_view_permission_helper_delegate.cc
@@ -10,6 +10,7 @@
 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/render_messages.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "components/content_settings/core/common/permission_request_id.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/render_view_host.h"
diff --git a/chrome/browser/infobars/infobar_service.cc b/chrome/browser/infobars/infobar_service.cc
index 7fdd7ec..3bc0e4e 100644
--- a/chrome/browser/infobars/infobar_service.cc
+++ b/chrome/browser/infobars/infobar_service.cc
@@ -8,6 +8,7 @@
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/infobars/insecure_content_infobar_delegate.h"
 #include "chrome/common/render_messages.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "components/infobars/core/infobar.h"
 #include "content/public/browser/navigation_details.h"
 #include "content/public/browser/navigation_entry.h"
diff --git a/chrome/browser/infobars/insecure_content_infobar_delegate.cc b/chrome/browser/infobars/insecure_content_infobar_delegate.cc
index cb35acc..c54e93ce 100644
--- a/chrome/browser/infobars/insecure_content_infobar_delegate.cc
+++ b/chrome/browser/infobars/insecure_content_infobar_delegate.cc
@@ -8,6 +8,7 @@
 #include "chrome/browser/infobars/infobar_service.h"
 #include "chrome/common/render_messages.h"
 #include "chrome/grit/generated_resources.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "components/google/core/browser/google_util.h"
 #include "components/infobars/core/infobar.h"
 #include "content/public/browser/render_frame_host.h"
diff --git a/chrome/browser/plugins/chrome_plugin_service_filter.cc b/chrome/browser/plugins/chrome_plugin_service_filter.cc
index 324b67f1e..2c16ac2 100644
--- a/chrome/browser/plugins/chrome_plugin_service_filter.cc
+++ b/chrome/browser/plugins/chrome_plugin_service_filter.cc
@@ -12,6 +12,7 @@
 #include "chrome/browser/plugins/plugin_prefs.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/render_messages.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/plugin_service.h"
diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc
index 1b56a3f..02877936 100644
--- a/chrome/browser/plugins/plugin_observer.cc
+++ b/chrome/browser/plugins/plugin_observer.cc
@@ -21,6 +21,7 @@
 #include "chrome/common/render_messages.h"
 #include "chrome/common/url_constants.h"
 #include "chrome/grit/generated_resources.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "components/content_settings/core/browser/host_content_settings_map.h"
 #include "components/infobars/core/confirm_infobar_delegate.h"
 #include "components/infobars/core/infobar.h"
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index 43e3d8f..4c1c9838 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -20,6 +20,7 @@
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
 #include "chrome/common/render_messages.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "components/network_hints/common/network_hints_common.h"
 #include "components/network_hints/common/network_hints_messages.h"
 #include "components/rappor/rappor_service.h"
@@ -49,6 +50,7 @@
 
 const uint32 kFilteredMessageClasses[] = {
   ChromeMsgStart,
+  ContentSettingsMsgStart,
   NetworkHintsMsgStart,
 };
 
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index eead7faa..3d9d4e1 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -25,6 +25,7 @@
 #include "chrome/common/pref_names.h"
 #include "chrome/common/render_messages.h"
 #include "chrome/grit/generated_resources.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "components/content_settings/core/browser/content_settings_utils.h"
 #include "components/content_settings/core/common/content_settings.h"
 #include "content/public/browser/notification_service.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index bcd49c9..a0de3f2 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2980,6 +2980,7 @@
         '../components/components.gyp:cloud_devices_common',
         '../components/components.gyp:component_metrics_proto',
         '../components/components.gyp:component_updater',
+        '../components/components.gyp:content_settings_content_common',
         '../components/components.gyp:content_settings_core_browser',
         '../components/components.gyp:content_settings_core_common',
         '../components/components.gyp:crx_file',
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index 4a09173..cb733fdb 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -251,6 +251,7 @@
         'chrome_resources.gyp:chrome_strings',
         '../third_party/re2/re2.gyp:re2',
         '../components/components.gyp:autofill_content_renderer',
+        '../components/components.gyp:content_settings_content_common',
         '../components/components.gyp:cdm_renderer',
         '../components/components.gyp:data_reduction_proxy_content_common',
         '../components/components.gyp:network_hints_renderer',
diff --git a/chrome/common/common_param_traits_macros.h b/chrome/common/common_param_traits_macros.h
index 6a57d08..d5b75a4b 100644
--- a/chrome/common/common_param_traits_macros.h
+++ b/chrome/common/common_param_traits_macros.h
@@ -9,10 +9,8 @@
 #define CHROME_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
 
 #include "components/content_settings/core/common/content_settings.h"
-#include "components/content_settings/core/common/content_settings_types.h"
 #include "ipc/ipc_message_macros.h"
 
 IPC_ENUM_TRAITS_MAX_VALUE(ContentSetting, CONTENT_SETTING_NUM_SETTINGS - 1)
-IPC_ENUM_TRAITS_MAX_VALUE(ContentSettingsType, CONTENT_SETTINGS_NUM_TYPES - 1)
 
 #endif  // CHROME_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 8b0cf7c..e3f38656 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -25,7 +25,6 @@
 #include "chrome/common/web_application_info.h"
 #include "components/content_settings/core/common/content_settings.h"
 #include "components/content_settings/core/common/content_settings_pattern.h"
-#include "components/content_settings/core/common/content_settings_types.h"
 #include "components/nacl/common/nacl_types.h"
 #include "content/public/common/common_param_traits.h"
 #include "content/public/common/referrer.h"
@@ -225,10 +224,6 @@
 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetContentSettingRules,
                      RendererContentSettingRules /* rules */)
 
-// Tells the render frame to load all blocked plugins with the given identifier.
-IPC_MESSAGE_ROUTED1(ChromeViewMsg_LoadBlockedPlugins,
-                    std::string /* identifier */)
-
 // Asks the renderer to send back stats on the WebCore cache broken down by
 // resource types.
 IPC_MESSAGE_CONTROL0(ChromeViewMsg_GetCacheResourceStats)
@@ -289,21 +284,6 @@
 IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetIsIncognitoProcess,
                      bool /* is_incognito_processs */)
 
-// 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 */)
-
 // Sent when the profile changes the kSafeBrowsingEnabled preference.
 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetClientSidePhishingDetection,
                     bool /* enable_phishing_detection */)
@@ -361,9 +341,6 @@
 
 // JavaScript related messages -----------------------------------------------
 
-// Tells the frame it is displaying an interstitial page.
-IPC_MESSAGE_ROUTED0(ChromeViewMsg_SetAsInterstitial)
-
 // Provides the renderer with the results of the browser's investigation into
 // why a recent main frame load failed (currently, just DNS probe result).
 // NetErrorHelper will receive this mesage and replace or update the error
@@ -387,31 +364,6 @@
 IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_UpdatedCacheStats,
                      blink::WebCache::UsageStats /* stats */)
 
-// 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_SYNC_MESSAGE_CONTROL3_1(ChromeViewHostMsg_RequestFileSystemAccessSync,
@@ -420,23 +372,6 @@
                             GURL /* top origin url */,
                             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 */)
-
 // Return information about a plugin for the given URL and MIME type.
 // In contrast to ViewHostMsg_GetPluginInfo in content/, this IPC call knows
 // about specific reasons why a plugin can't be used, for example because it's
@@ -514,9 +449,6 @@
                     int /* request_id */,
                     std::string /* platform */)
 
-// Tells the renderer that the NPAPI cannot be used. For example Ash on windows.
-IPC_MESSAGE_ROUTED0(ChromeViewMsg_NPAPINotSupported)
-
 // Notification that the page has an OpenSearch description document
 // associated with it.
 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_PageHasOSDD,
@@ -557,10 +489,6 @@
 // only when the renderer is prerendering.
 IPC_MESSAGE_ROUTED0(ChromeViewHostMsg_CancelPrerenderForPrinting)
 
-// 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)
-
 IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_DidGetWebApplicationInfo,
                     WebApplicationInfo)
 
diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn
index 25dc37c7..312a879 100644
--- a/chrome/renderer/BUILD.gn
+++ b/chrome/renderer/BUILD.gn
@@ -36,6 +36,7 @@
     "//chrome:resources",
     "//chrome:strings",
     "//components/autofill/content/renderer",
+    "//components/content_settings/content/common",
     "//components/cdm/renderer",
     "//components/data_reduction_proxy/content/common",
     "//components/network_hints/renderer",
diff --git a/chrome/renderer/DEPS b/chrome/renderer/DEPS
index a2a6e27..2dbacc1 100644
--- a/chrome/renderer/DEPS
+++ b/chrome/renderer/DEPS
@@ -5,6 +5,7 @@
   "+components/autofill/content/renderer",
   "+components/autofill/core/common",
   "+components/cdm/renderer",
+  "+components/content_settings/content/common",
   "+components/content_settings/core/common",
   "+components/crx_file",
   "+components/data_reduction_proxy/content/common",
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 1158539e..5e7c96a 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -6,7 +6,7 @@
 
 #include "base/command_line.h"
 #include "base/metrics/histogram.h"
-#include "chrome/common/render_messages.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "content/public/common/url_constants.h"
 #include "content/public/renderer/document_state.h"
 #include "content/public/renderer/render_frame.h"
diff --git a/chrome/renderer/content_settings_observer_browsertest.cc b/chrome/renderer/content_settings_observer_browsertest.cc
index e6378bb..ae66afe 100644
--- a/chrome/renderer/content_settings_observer_browsertest.cc
+++ b/chrome/renderer/content_settings_observer_browsertest.cc
@@ -6,6 +6,7 @@
 #include "chrome/common/render_messages.h"
 #include "chrome/renderer/content_settings_observer.h"
 #include "chrome/test/base/chrome_render_view_test.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "content/public/renderer/render_view.h"
 #include "ipc/ipc_message_macros.h"
 #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.cc b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
index 61a84ba..6b60c3b 100644
--- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -14,6 +14,7 @@
 #include "chrome/renderer/chrome_content_renderer_client.h"
 #include "chrome/renderer/custom_menu_commands.h"
 #include "chrome/renderer/plugins/plugin_uma.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "content/app/strings/grit/content_strings.h"
 #include "content/public/common/context_menu_params.h"
 #include "content/public/renderer/render_frame.h"
diff --git a/chrome/renderer/worker_content_settings_client_proxy.cc b/chrome/renderer/worker_content_settings_client_proxy.cc
index dc0395e..31d83d2 100644
--- a/chrome/renderer/worker_content_settings_client_proxy.cc
+++ b/chrome/renderer/worker_content_settings_client_proxy.cc
@@ -5,6 +5,7 @@
 #include "chrome/renderer/worker_content_settings_client_proxy.h"
 
 #include "chrome/common/render_messages.h"
+#include "components/content_settings/content/common/content_settings_messages.h"
 #include "content/public/renderer/render_frame.h"
 #include "content/public/renderer/render_thread.h"
 #include "ipc/ipc_sync_message_filter.h"
diff --git a/components/content_settings.gypi b/components/content_settings.gypi
index b0fca08..89f2b1a 100644
--- a/components/content_settings.gypi
+++ b/components/content_settings.gypi
@@ -102,5 +102,26 @@
         'content_settings/core/test/content_settings_test_utils.h',
       ],
     },
+    {
+      # GN version: //components/content_settings/content/common
+      'target_name': 'content_settings_content_common',
+      'type': 'static_library',
+      'dependencies': [
+        'content_settings_core_common',
+        '../base/base.gyp:base',
+        '../content/content.gyp:content_common',
+        '../ipc/ipc.gyp:ipc',
+        '../url/url.gyp:url_lib',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'sources': [
+        # Note: sources list duplicated in GN build.
+        'content_settings/content/common/content_settings_message_generator.cc',
+        'content_settings/content/common/content_settings_message_generator.h',
+        'content_settings/content/common/content_settings_messages.h',
+      ],
+    },
   ],
 }
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..5da2f626
--- /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*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
+per-file *_messages*[email protected]
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)
diff --git a/ipc/ipc_message_start.h b/ipc/ipc_message_start.h
index 5246eec..1eda50a 100644
--- a/ipc/ipc_message_start.h
+++ b/ipc/ipc_message_start.h
@@ -120,6 +120,7 @@
   // Contact gunsch@ before changing/removing.
   CastCryptoMsgStart,
   DataReductionProxyStart,
+  ContentSettingsMsgStart,
   LastIPCMsgStart  // Must come last.
 };
 
diff --git a/tools/ipc_fuzzer/message_lib/DEPS b/tools/ipc_fuzzer/message_lib/DEPS
index 98c66d63..b2aa999 100644
--- a/tools/ipc_fuzzer/message_lib/DEPS
+++ b/tools/ipc_fuzzer/message_lib/DEPS
@@ -1,6 +1,7 @@
 include_rules = [
   "+chrome/common",
   "+components/autofill/content/common",
+  "+components/content_settings/content/common",
   "+components/dns_prefetch/common",
   "+components/nacl/common",
   "+components/network_hints/common",
diff --git a/tools/ipc_fuzzer/message_lib/all_messages.h b/tools/ipc_fuzzer/message_lib/all_messages.h
index f9430ad..9ae26049 100644
--- a/tools/ipc_fuzzer/message_lib/all_messages.h
+++ b/tools/ipc_fuzzer/message_lib/all_messages.h
@@ -16,6 +16,7 @@
 
 #include "chrome/common/all_messages.h"
 #include "components/autofill/content/common/autofill_message_generator.h"
+#include "components/content_settings/content/common/content_settings_message_generator.h"
 #include "components/nacl/common/nacl_host_messages.h"
 #include "components/network_hints/common/network_hints_message_generator.h"
 #include "components/password_manager/content/common/credential_manager_message_generator.h"
diff --git a/tools/ipc_fuzzer/message_lib/message_lib.gyp b/tools/ipc_fuzzer/message_lib/message_lib.gyp
index 29e9133..8f01490 100644
--- a/tools/ipc_fuzzer/message_lib/message_lib.gyp
+++ b/tools/ipc_fuzzer/message_lib/message_lib.gyp
@@ -9,6 +9,7 @@
       '../../../base/base.gyp:base',
       '../../../chrome/chrome.gyp:common',
       '../../../chrome/chrome.gyp:safe_browsing_proto',
+      '../../../components/components.gyp:content_settings_content_common',
       '../../../components/components.gyp:pdf_common',
       '../../../components/nacl.gyp:nacl_common',
       '../../../content/content.gyp:content_child',