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

Side by Side Diff: chrome/browser/extensions/api/hotword_private/hotword_private_api.cc

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/api/hotword_private/hotword_private_api.h" 5 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 void HotwordPrivateEventService::OnMicrophoneStateChanged(bool enabled) { 127 void HotwordPrivateEventService::OnMicrophoneStateChanged(bool enabled) {
128 SignalEvent(events::HOTWORD_PRIVATE_ON_MICROPHONE_STATE_CHANGED, 128 SignalEvent(events::HOTWORD_PRIVATE_ON_MICROPHONE_STATE_CHANGED,
129 api::hotword_private::OnMicrophoneStateChanged::kEventName, 129 api::hotword_private::OnMicrophoneStateChanged::kEventName,
130 api::hotword_private::OnMicrophoneStateChanged::Create(enabled)); 130 api::hotword_private::OnMicrophoneStateChanged::Create(enabled));
131 } 131 }
132 132
133 void HotwordPrivateEventService::SignalEvent( 133 void HotwordPrivateEventService::SignalEvent(
134 events::HistogramValue histogram_value, 134 events::HistogramValue histogram_value,
135 const std::string& event_name) { 135 const std::string& event_name) {
136 SignalEvent(histogram_value, event_name, 136 SignalEvent(histogram_value, event_name, base::MakeUnique<base::ListValue>());
137 base::WrapUnique(new base::ListValue()));
138 } 137 }
139 138
140 void HotwordPrivateEventService::SignalEvent( 139 void HotwordPrivateEventService::SignalEvent(
141 events::HistogramValue histogram_value, 140 events::HistogramValue histogram_value,
142 const std::string& event_name, 141 const std::string& event_name,
143 std::unique_ptr<base::ListValue> args) { 142 std::unique_ptr<base::ListValue> args) {
144 EventRouter* router = EventRouter::Get(profile_); 143 EventRouter* router = EventRouter::Get(profile_);
145 if (!router || !router->HasEventListener(event_name)) 144 if (!router || !router->HasEventListener(event_name))
146 return; 145 return;
147 146
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 HotwordService* hotword_service = 520 HotwordService* hotword_service =
522 HotwordServiceFactory::GetForProfile(GetProfile()); 521 HotwordServiceFactory::GetForProfile(GetProfile());
523 if (!hotword_service) 522 if (!hotword_service)
524 return false; 523 return false;
525 524
526 hotword_service->SpeakerModelExistsComplete(params->exists); 525 hotword_service->SpeakerModelExistsComplete(params->exists);
527 return true; 526 return true;
528 } 527 }
529 528
530 } // namespace extensions 529 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698