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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_extension_function.cc

Issue 1412493002: Bluetooth extension api fixes for WebUI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_543294_bluetooth_idl
Patch Set: Created 5 years, 2 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: extensions/browser/api/bluetooth/bluetooth_extension_function.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_extension_function.cc b/extensions/browser/api/bluetooth/bluetooth_extension_function.cc
index 003a8393213f8e56c597358bc243908b1120f18a..028f144ab4fc2c83f28f21f637dd8711e6858dcd 100644
--- a/extensions/browser/api/bluetooth/bluetooth_extension_function.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_extension_function.cc
@@ -6,10 +6,12 @@
#include "base/memory/ref_counted.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/web_contents.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "extensions/browser/api/bluetooth/bluetooth_api.h"
#include "extensions/browser/api/bluetooth/bluetooth_event_router.h"
+#include "url/gurl.h"
using content::BrowserThread;
@@ -59,6 +61,12 @@ bool BluetoothExtensionFunction::RunAsync() {
return true;
}
+std::string BluetoothExtensionFunction::GetExtensionId() {
+ if (extension())
+ return extension()->id();
+ return GetSenderWebContents()->GetURL().host();
+}
+
void BluetoothExtensionFunction::RunOnAdapterReady(
scoped_refptr<device::BluetoothAdapter> adapter) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);

Powered by Google App Engine
This is Rietveld 408576698