diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-15 18:22:41 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-15 18:22:41 +0000 |
commit | 2c699655d5ed9cbf296a9389c3efe2a9fe01973e (patch) | |
tree | 843da73da9228499bf88063490fba73845740740 /chrome/browser/extensions/extension_messages_apitest.cc | |
parent | 731ae5165404c2ccf32af50ac3fda3364d41fbb1 (diff) | |
download | chromium_src-2c699655d5ed9cbf296a9389c3efe2a9fe01973e.zip chromium_src-2c699655d5ed9cbf296a9389c3efe2a9fe01973e.tar.gz chromium_src-2c699655d5ed9cbf296a9389c3efe2a9fe01973e.tar.bz2 |
Pull events-related code out of ExtensionMessageService into its own class.
The events code is independent of the messaging code and didn't belong in the
same class.
This is part 1 of an extension event refactor. See bug for more details.
BUG=58214
TEST=covered by tests
Review URL: http://codereview.chromium.org/3758005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_messages_apitest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_messages_apitest.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/extensions/extension_messages_apitest.cc b/chrome/browser/extensions/extension_messages_apitest.cc index 533b840..b76a944 100644 --- a/chrome/browser/extensions/extension_messages_apitest.cc +++ b/chrome/browser/extensions/extension_messages_apitest.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" -#include "chrome/browser/extensions/extension_message_service.h" +#include "chrome/browser/extensions/extension_event_router.h" #include "chrome/browser/profile.h" #include "chrome/common/notification_registrar.h" #include "googleurl/src/gurl.h" @@ -21,24 +21,24 @@ class MessageSender : public NotificationObserver { virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - ExtensionMessageService* message_service = - Source<Profile>(source).ptr()->GetExtensionMessageService(); + ExtensionEventRouter* event_router = + Source<Profile>(source).ptr()->GetExtensionEventRouter(); // Sends four messages to the extension. All but the third message sent // from the origin http://b.com/ are supposed to arrive. - message_service->DispatchEventToRenderers("test.onMessage", + event_router->DispatchEventToRenderers("test.onMessage", "[{\"lastMessage\":false,\"data\":\"no restriction\"}]", Source<Profile>(source).ptr(), GURL()); - message_service->DispatchEventToRenderers("test.onMessage", + event_router->DispatchEventToRenderers("test.onMessage", "[{\"lastMessage\":false,\"data\":\"http://a.com/\"}]", Source<Profile>(source).ptr(), GURL("http://a.com/")); - message_service->DispatchEventToRenderers("test.onMessage", + event_router->DispatchEventToRenderers("test.onMessage", "[{\"lastMessage\":false,\"data\":\"http://b.com/\"}]", Source<Profile>(source).ptr(), GURL("http://b.com/")); - message_service->DispatchEventToRenderers("test.onMessage", + event_router->DispatchEventToRenderers("test.onMessage", "[{\"lastMessage\":true,\"data\":\"last message\"}]", Source<Profile>(source).ptr(), GURL()); |