From c4b717a7763a8509b525ecbcf1d0f03d7eed83b6 Mon Sep 17 00:00:00 2001 From: "yoz@chromium.org" Date: Tue, 25 Feb 2014 19:24:41 +0000 Subject: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 3). This is the last part. Follows part 1: https://chromiumcodereview.appspot.com/171813010/ BUG=309909 R=jamescook@chromium.org TBR=brettw@chromium.org, dtseng@chromium.org, erg@chromium.org Review URL: https://codereview.chromium.org/174513003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253223 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/speech/extension_api/tts_extension_api.cc | 8 +------- chrome/browser/speech/extension_api/tts_extension_api.h | 9 ++++----- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'chrome/browser/speech') diff --git a/chrome/browser/speech/extension_api/tts_extension_api.cc b/chrome/browser/speech/extension_api/tts_extension_api.cc index e9fd625..dcb5e3a 100644 --- a/chrome/browser/speech/extension_api/tts_extension_api.cc +++ b/chrome/browser/speech/extension_api/tts_extension_api.cc @@ -10,7 +10,6 @@ #include "base/memory/weak_ptr.h" #include "base/values.h" #include "chrome/browser/extensions/extension_function_registry.h" -#include "chrome/browser/profiles/profile.h" #include "chrome/browser/speech/extension_api/tts_engine_extension_api.h" #include "chrome/browser/speech/extension_api/tts_extension_api_constants.h" #include "chrome/browser/speech/tts_controller.h" @@ -342,12 +341,7 @@ bool TtsGetVoicesFunction::RunImpl() { return true; } -// static -TtsAPI* TtsAPI::Get(Profile* profile) { - return ProfileKeyedAPIFactory::GetForProfile(profile); -} - -TtsAPI::TtsAPI(Profile* profile) { +TtsAPI::TtsAPI(content::BrowserContext* context) { ExtensionFunctionRegistry* registry = ExtensionFunctionRegistry::GetInstance(); registry->RegisterFunction(); diff --git a/chrome/browser/speech/extension_api/tts_extension_api.h b/chrome/browser/speech/extension_api/tts_extension_api.h index a8f3c19..4746e09 100644 --- a/chrome/browser/speech/extension_api/tts_extension_api.h +++ b/chrome/browser/speech/extension_api/tts_extension_api.h @@ -11,7 +11,9 @@ #include "chrome/browser/extensions/chrome_extension_function.h" #include "chrome/browser/speech/tts_controller.h" -class Profile; +namespace content { +class BrowserContext; +} const char *TtsEventTypeToString(TtsEventType event_type); TtsEventType TtsEventTypeFromString(const std::string& str); @@ -62,12 +64,9 @@ class TtsGetVoicesFunction : public ChromeSyncExtensionFunction { class TtsAPI : public ProfileKeyedAPI { public: - explicit TtsAPI(Profile* profile); + explicit TtsAPI(content::BrowserContext* context); virtual ~TtsAPI(); - // Convenience method to get the TtsAPI for a profile. - static TtsAPI* Get(Profile* profile); - // ProfileKeyedAPI implementation. static ProfileKeyedAPIFactory* GetFactoryInstance(); -- cgit v1.1