Index: content/browser/renderer_host/url_handling_message_filter.h |
diff --git a/content/browser/renderer_host/url_handling_message_filter.h b/content/browser/renderer_host/url_handling_message_filter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..28697e489c5e9bba0a7422db700051973a96bbce |
--- /dev/null |
+++ b/content/browser/renderer_host/url_handling_message_filter.h |
@@ -0,0 +1,46 @@ |
+// Copyright (c) 2013 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. |
+ |
+#ifndef CONTENT_BROWSER_RENDERER_HOST_URL_HANDLING_MESSAGE_FILTER_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_URL_HANDLING_MESSAGE_FILTER_H_ |
+ |
+#include <string> |
+ |
+#include "content/public/browser/browser_message_filter.h" |
+ |
+class GURL; |
+ |
+namespace content { |
+ |
+class RenderProcessHost; |
+ |
+// This class filters out incoming IPC messages for the extension system on the |
jam
2013/08/30 16:16:38
extension code, in content? sounds like a layering
sergeygs
2013/09/02 07:36:21
After discussing this in person, I've used your ad
|
+// browser IPC thread. |
+class UrlHandlingMessageFilter : public BrowserMessageFilter { |
+ public: |
+ // Create the filter. |
+ UrlHandlingMessageFilter(RenderProcessHost* render_process_host); |
+ |
+ // BrowserMessageFilter methods: |
+ virtual bool OnMessageReceived(const IPC::Message& message, |
+ bool* message_was_ok) OVERRIDE; |
+ |
+ // OnMessageReceived sends notifications to the browser through |
+ // NotificationService: to reach the target, these need to be on the UI |
+ // thread, so we have to override. |
+ virtual void OverrideThreadForMessage( |
+ const IPC::Message& message, |
+ content::BrowserThread::ID* thread) OVERRIDE; |
+ |
+ private: |
+ virtual ~UrlHandlingMessageFilter(); |
+ |
+ bool OnForwardUrlToBrowser(const GURL& url, const GURL& referrer_url); |
+ |
+ RenderProcessHost* render_process_host_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_URL_HANDLING_MESSAGE_FILTER_H_ |