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

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

Issue 177003015: Pull AsyncApiFunction out of src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase for storage_api Created 6 years, 10 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/bluetooth/bluetooth_extension_function.cc
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc
index f3f6073c64fafca5c28655cdb4e76f0f10017d07..caad6209cc82a18f14a43c1b8e5ffbc562dcbb6e 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc
@@ -7,7 +7,6 @@
#include "base/memory/ref_counted.h"
#include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
#include "chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h"
-#include "chrome/browser/profiles/profile.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
@@ -16,18 +15,18 @@ namespace {
const char kPlatformNotSupported[] =
"This operation is not supported on your platform";
-extensions::ExtensionBluetoothEventRouter* GetEventRouter(Profile* profile) {
- return extensions::BluetoothAPI::Get(profile)->bluetooth_event_router();
+extensions::ExtensionBluetoothEventRouter* GetEventRouter(
+ content::BrowserContext* context) {
+ return extensions::BluetoothAPI::Get(context)->bluetooth_event_router();
}
-bool IsBluetoothSupported(Profile* profile) {
- return GetEventRouter(profile)->IsBluetoothSupported();
+bool IsBluetoothSupported(content::BrowserContext* context) {
+ return GetEventRouter(context)->IsBluetoothSupported();
}
-void GetAdapter(
- const device::BluetoothAdapterFactory::AdapterCallback callback,
- Profile* profile) {
- GetEventRouter(profile)->GetAdapter(callback);
+void GetAdapter(const device::BluetoothAdapterFactory::AdapterCallback callback,
+ content::BrowserContext* context) {
+ GetEventRouter(context)->GetAdapter(callback);
}
} // namespace
@@ -43,12 +42,12 @@ BluetoothExtensionFunction::~BluetoothExtensionFunction() {
}
bool BluetoothExtensionFunction::RunImpl() {
- if (!IsBluetoothSupported(GetProfile())) {
+ if (!IsBluetoothSupported(browser_context())) {
SetError(kPlatformNotSupported);
return false;
}
GetAdapter(base::Bind(&BluetoothExtensionFunction::RunOnAdapterReady, this),
- GetProfile());
+ browser_context());
return true;
}

Powered by Google App Engine
This is Rietveld 408576698