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

Side by Side Diff: chrome/browser/chromeos/extensions/media_player_event_router.cc

Issue 10694085: Refactor extension event distribution to use Values instead of JSON strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing memory leak in a test. Created 8 years, 4 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/chromeos/extensions/media_player_event_router.h" 5 #include "chrome/browser/chromeos/extensions/media_player_event_router.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/browser/extensions/event_router.h" 8 #include "chrome/browser/extensions/event_router.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 10
11 ExtensionMediaPlayerEventRouter::ExtensionMediaPlayerEventRouter() 11 ExtensionMediaPlayerEventRouter::ExtensionMediaPlayerEventRouter()
12 : profile_(NULL) { 12 : profile_(NULL) {
13 } 13 }
14 14
15 ExtensionMediaPlayerEventRouter* 15 ExtensionMediaPlayerEventRouter*
16 ExtensionMediaPlayerEventRouter::GetInstance() { 16 ExtensionMediaPlayerEventRouter::GetInstance() {
17 return Singleton<ExtensionMediaPlayerEventRouter>::get(); 17 return Singleton<ExtensionMediaPlayerEventRouter>::get();
18 } 18 }
19 19
20 void ExtensionMediaPlayerEventRouter::Init(Profile* profile) { 20 void ExtensionMediaPlayerEventRouter::Init(Profile* profile) {
21 profile_ = profile; 21 profile_ = profile;
22 } 22 }
23 23
24 void ExtensionMediaPlayerEventRouter::NotifyPlaylistChanged() { 24 void ExtensionMediaPlayerEventRouter::NotifyPlaylistChanged() {
25 if (profile_ && profile_->GetExtensionEventRouter()) { 25 if (profile_ && profile_->GetExtensionEventRouter()) {
26 scoped_ptr<ListValue> args(new ListValue());
26 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( 27 profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
27 "mediaPlayerPrivate.onPlaylistChanged", "[]", NULL, GURL()); 28 "mediaPlayerPrivate.onPlaylistChanged", args.Pass(), NULL, GURL());
28 } 29 }
29 } 30 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/input_method_event_router.cc ('k') | chrome/browser/extensions/api/alarms/alarm_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698