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

Unified Diff: chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc

Issue 15738013: Initial implementation of music manager private API. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebasing. Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc
diff --git a/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc b/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..68659c0b8ce33258afe9928f131a5651258b91d4
--- /dev/null
+++ b/chrome/browser/extensions/api/music_manager_private/music_manager_private_api.cc
@@ -0,0 +1,47 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/music_manager_private/music_manager_private_api.h"
+#include "chrome/browser/extensions/api/music_manager_private/device_id.h"
+
+using content::BrowserThread;
+
+namespace {
+
+const char kDeviceIDNotSupported[] =
+ "Device ID API is not supported on this platform.";
+
+}
+
+namespace extensions {
+
+namespace api {
+
+MusicManagerPrivateGetDeviceIdFunction::
+ MusicManagerPrivateGetDeviceIdFunction() {
+}
+
+MusicManagerPrivateGetDeviceIdFunction::
+ ~MusicManagerPrivateGetDeviceIdFunction() {
+}
+
+bool MusicManagerPrivateGetDeviceIdFunction::RunImpl() {
+ std::string salt = this->extension_id();
+ std::string result = device_id::GetDeviceID(salt);
+ bool response;
+ if (result.empty()) {
+ SetError(kDeviceIDNotSupported);
+ response = false;
+ } else {
+ SetResult(Value::CreateStringValue(result));
+ response = true;
+ }
+
+ SendResponse(response);
+ return response;
+}
+
+} // namespace api
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698