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

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

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
11 #include "extensions/browser/event_router.h" 11 #include "extensions/browser/event_router.h"
12 #include "extensions/browser/extension_system.h" 12 #include "extensions/browser/extension_system.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 namespace { 16 namespace {
17 17
18 void BroadcastEvent(content::BrowserContext* context, 18 void BroadcastEvent(content::BrowserContext* context,
19 events::HistogramValue histogram_value, 19 events::HistogramValue histogram_value,
20 const std::string& event_name) { 20 const std::string& event_name) {
21 if (context && EventRouter::Get(context)) { 21 if (context && EventRouter::Get(context)) {
22 scoped_ptr<base::ListValue> args(new base::ListValue()); 22 std::unique_ptr<base::ListValue> args(new base::ListValue());
23 scoped_ptr<Event> event( 23 std::unique_ptr<Event> event(
24 new Event(histogram_value, event_name, std::move(args))); 24 new Event(histogram_value, event_name, std::move(args)));
25 EventRouter::Get(context)->BroadcastEvent(std::move(event)); 25 EventRouter::Get(context)->BroadcastEvent(std::move(event));
26 } 26 }
27 } 27 }
28 28
29 } // namespace 29 } // namespace
30 30
31 MediaPlayerEventRouter::MediaPlayerEventRouter(content::BrowserContext* context) 31 MediaPlayerEventRouter::MediaPlayerEventRouter(content::BrowserContext* context)
32 : browser_context_(context) {} 32 : browser_context_(context) {}
33 33
(...skipping 10 matching lines...) Expand all
44 "mediaPlayerPrivate.onPrevTrack"); 44 "mediaPlayerPrivate.onPrevTrack");
45 } 45 }
46 46
47 void MediaPlayerEventRouter::NotifyTogglePlayState() { 47 void MediaPlayerEventRouter::NotifyTogglePlayState() {
48 BroadcastEvent(browser_context_, 48 BroadcastEvent(browser_context_,
49 events::MEDIA_PLAYER_PRIVATE_ON_TOGGLE_PLAY_STATE, 49 events::MEDIA_PLAYER_PRIVATE_ON_TOGGLE_PLAY_STATE,
50 "mediaPlayerPrivate.onTogglePlayState"); 50 "mediaPlayerPrivate.onTogglePlayState");
51 } 51 }
52 52
53 } // namespace extensions 53 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698