Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2048)

Side by Side Diff: chrome/browser/extensions/extension_devtools_bridge.cc

Issue 10514013: Filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: split out event_filter changes Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/extensions/extension_devtools_bridge.h" 5 #include "chrome/browser/extensions/extension_devtools_bridge.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 // If the tab we are looking at is going away then we fire a closing event at 101 // If the tab we are looking at is going away then we fire a closing event at
102 // the extension. 102 // the extension.
103 void ExtensionDevToolsBridge::InspectedContentsClosing() { 103 void ExtensionDevToolsBridge::InspectedContentsClosing() {
104 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); 104 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI);
105 105
106 // TODO(knorton): Remove this event in favor of the standard tabs.onRemoved 106 // TODO(knorton): Remove this event in favor of the standard tabs.onRemoved
107 // event in extensions. 107 // event in extensions.
108 std::string json("[{}]"); 108 std::string json("[{}]");
109 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( 109 profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
110 on_tab_close_event_name_, json, profile_, GURL()); 110 on_tab_close_event_name_, json, profile_, GURL(), EventFilteringInfo());
111 111
112 // This may result in this object being destroyed. 112 // This may result in this object being destroyed.
113 extension_devtools_manager_->BridgeClosingForTab(tab_id_); 113 extension_devtools_manager_->BridgeClosingForTab(tab_id_);
114 } 114 }
115 115
116 void ExtensionDevToolsBridge::DispatchOnInspectorFrontend( 116 void ExtensionDevToolsBridge::DispatchOnInspectorFrontend(
117 const std::string& data) { 117 const std::string& data) {
118 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); 118 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI);
119 119
120 std::string json = base::StringPrintf("[%s]", data.c_str()); 120 std::string json = base::StringPrintf("[%s]", data.c_str());
121 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( 121 profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
122 on_page_event_name_, json, profile_, GURL()); 122 on_page_event_name_, json, profile_, GURL(), EventFilteringInfo());
123 } 123 }
124 124
125 void ExtensionDevToolsBridge::ContentsReplaced(WebContents* new_contents) { 125 void ExtensionDevToolsBridge::ContentsReplaced(WebContents* new_contents) {
126 // We don't update the tab id as it needs to remain the same so that we can 126 // We don't update the tab id as it needs to remain the same so that we can
127 // properly unregister. 127 // properly unregister.
128 } 128 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698