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

Side by Side Diff: extensions/browser/api/audio/audio_service_chromeos.cc

Issue 1584613003: Expose stable_device_id in audio extension apis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "extensions/browser/api/audio/audio_service.h" 5 #include "extensions/browser/api/audio/audio_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 info->is_active = devices[i].active; 266 info->is_active = devices[i].active;
267 info->is_muted = 267 info->is_muted =
268 devices[i].is_input 268 devices[i].is_input
269 ? cras_audio_handler_->IsInputMutedForDevice(devices[i].id) 269 ? cras_audio_handler_->IsInputMutedForDevice(devices[i].id)
270 : cras_audio_handler_->IsOutputMutedForDevice(devices[i].id); 270 : cras_audio_handler_->IsOutputMutedForDevice(devices[i].id);
271 info->level = 271 info->level =
272 devices[i].is_input 272 devices[i].is_input
273 ? cras_audio_handler_->GetOutputVolumePercentForDevice( 273 ? cras_audio_handler_->GetOutputVolumePercentForDevice(
274 devices[i].id) 274 devices[i].id)
275 : cras_audio_handler_->GetInputGainPercentForDevice(devices[i].id); 275 : cras_audio_handler_->GetInputGainPercentForDevice(devices[i].id);
276 // TODO(jennyz): Set stable_device_id once it is implemented. 276 info->stable_device_id.reset(
277 // See crbug.com/466768. 277 new std::string(base::Uint64ToString(devices[i].stable_device_id)));
278 278
279 devices_info_list.push_back(info); 279 devices_info_list.push_back(info);
280 } 280 }
281 281
282 FOR_EACH_OBSERVER(AudioService::Observer, observer_list_, 282 FOR_EACH_OBSERVER(AudioService::Observer, observer_list_,
283 OnDevicesChanged(devices_info_list)); 283 OnDevicesChanged(devices_info_list));
284 284
285 // Notify DeviceChanged event for backward compatibility. 285 // Notify DeviceChanged event for backward compatibility.
286 // TODO(jennyz): remove this code when the old version of hotrod retires. 286 // TODO(jennyz): remove this code when the old version of hotrod retires.
287 NotifyDeviceChanged(); 287 NotifyDeviceChanged();
288 } 288 }
289 289
290 AudioService* AudioService::CreateInstance() { 290 AudioService* AudioService::CreateInstance() {
291 return new AudioServiceImpl; 291 return new AudioServiceImpl;
292 } 292 }
293 293
294 } // namespace extensions 294 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/audio/audio_apitest.cc ('k') | extensions/test/data/api_test/audio/add_nodes/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698