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

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

Issue 147923005: Split ExtensionSystem interface from ExtensionSystemImpl implementation, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re^3base Created 6 years, 10 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/extension_system.h"
9 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
10 #include "extensions/browser/event_router.h" 9 #include "extensions/browser/event_router.h"
10 #include "extensions/browser/extension_system.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 static void BroadcastEvent(Profile* profile, const std::string& event_name) { 14 static void BroadcastEvent(Profile* profile, const std::string& event_name) {
15 if (profile && extensions::ExtensionSystem::Get(profile)->event_router()) { 15 if (profile && extensions::ExtensionSystem::Get(profile)->event_router()) {
16 scoped_ptr<base::ListValue> args(new base::ListValue()); 16 scoped_ptr<base::ListValue> args(new base::ListValue());
17 scoped_ptr<extensions::Event> event(new extensions::Event( 17 scoped_ptr<extensions::Event> event(new extensions::Event(
18 event_name, args.Pass())); 18 event_name, args.Pass()));
19 extensions::ExtensionSystem::Get(profile)->event_router()-> 19 extensions::ExtensionSystem::Get(profile)->event_router()->
20 BroadcastEvent(event.Pass()); 20 BroadcastEvent(event.Pass());
(...skipping 13 matching lines...) Expand all
34 34
35 void MediaPlayerEventRouter::NotifyPrevTrack() { 35 void MediaPlayerEventRouter::NotifyPrevTrack() {
36 BroadcastEvent(profile_, "mediaPlayerPrivate.onPrevTrack"); 36 BroadcastEvent(profile_, "mediaPlayerPrivate.onPrevTrack");
37 } 37 }
38 38
39 void MediaPlayerEventRouter::NotifyTogglePlayState() { 39 void MediaPlayerEventRouter::NotifyTogglePlayState() {
40 BroadcastEvent(profile_, "mediaPlayerPrivate.onTogglePlayState"); 40 BroadcastEvent(profile_, "mediaPlayerPrivate.onTogglePlayState");
41 } 41 }
42 42
43 } // namespace extensions 43 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698