From 659be688fc57bccd965cb8f7a7e6b3f7f248b9a7 Mon Sep 17 00:00:00 2001 From: "rockot@chromium.org" Date: Fri, 28 Feb 2014 15:06:45 +0000 Subject: Pull AsyncApiFunction out of src/chrome AsyncApiFunction now inherits UIThreadExtensionFunction directly, rather than depending on ChromeAsyncExtensionFunction. It's also been moved from chrome/browser/extensions/api/api_function.{h,cc} to extensions/browser/api/async_api_function.{h,cc}. With the exception of notifications API functions, anything which previously depended on AsyncApiFunction's inheritance of ChromeAsyncExtensionFunction was doing so only for GetProfile. In all cases, GetProfile() has been replaced with ExtensionFunction::browser_context() (renamed from context()). Finally, ApiFunction has been removed since it was identical to ChromeAsyncExtensionFunction. BUG=346949 TBR=dmazzoni@chromium.org,mfoltz@chromium.org,fgorski@chromium.org,courage@chromium.org,dewittj@chromium.org,rpaquay@chromium.org,kalman@chromium.org Review URL: https://codereview.chromium.org/177003015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254113 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/api/bluetooth/bluetooth_api.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'chrome/browser/extensions/api/bluetooth/bluetooth_api.h') diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h index e7b37ae..552b7dc 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h @@ -9,12 +9,17 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "chrome/browser/extensions/api/api_function.h" #include "chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h" #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" #include "device/bluetooth/bluetooth_device.h" #include "device/bluetooth/bluetooth_profile.h" +#include "extensions/browser/api/async_api_function.h" #include "extensions/browser/event_router.h" +#include "extensions/browser/extension_function.h" + +namespace content { +class BrowserContext; +} namespace device { @@ -57,7 +62,7 @@ class BluetoothAPI : public ProfileKeyedAPI, public EventRouter::Observer { static const bool kServiceRedirectedInIncognito = true; static const bool kServiceIsNULLWhileTesting = true; - Profile* profile_; + content::BrowserContext* browser_context_; // Created lazily on first access. scoped_ptr bluetooth_event_router_; @@ -65,7 +70,7 @@ class BluetoothAPI : public ProfileKeyedAPI, public EventRouter::Observer { namespace api { -class BluetoothAddProfileFunction : public ChromeAsyncExtensionFunction { +class BluetoothAddProfileFunction : public UIThreadExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.addProfile", BLUETOOTH_ADDPROFILE) @@ -85,7 +90,7 @@ class BluetoothAddProfileFunction : public ChromeAsyncExtensionFunction { std::string uuid_; }; -class BluetoothRemoveProfileFunction : public ChromeSyncExtensionFunction { +class BluetoothRemoveProfileFunction : public SyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.removeProfile", BLUETOOTH_REMOVEPROFILE) @@ -169,7 +174,7 @@ class BluetoothConnectFunction : public BluetoothExtensionFunction { void OnErrorCallback(); }; -class BluetoothDisconnectFunction : public ChromeSyncExtensionFunction { +class BluetoothDisconnectFunction : public SyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("bluetooth.disconnect", BLUETOOTH_DISCONNECT) -- cgit v1.1