summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/cookies
diff options
context:
space:
mode:
authorbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-28 21:19:23 +0000
committerbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-28 21:19:23 +0000
commit21a40087a57e13cc9b81cb7e8064f74587dfa8a1 (patch)
treee88d44c64fcaa47a5b45533a4d6c993de770757c /chrome/browser/extensions/api/cookies
parent0f75118d4799a7c5421150826eaccd1dfd253f8e (diff)
downloadchromium_src-21a40087a57e13cc9b81cb7e8064f74587dfa8a1.zip
chromium_src-21a40087a57e13cc9b81cb7e8064f74587dfa8a1.tar.gz
chromium_src-21a40087a57e13cc9b81cb7e8064f74587dfa8a1.tar.bz2
Remove Profile dependency from ExtensionFunction
This instead creates new variants of ExtensionFunction for Chrome APIs, which need Profile, and uses them for any API that needs to access Profiles. TBR=sky@chromium.org BUG=297942 Review URL: https://codereview.chromium.org/35893010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231406 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/api/cookies')
-rw-r--r--chrome/browser/extensions/api/cookies/cookies_api.cc8
-rw-r--r--chrome/browser/extensions/api/cookies/cookies_api.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc
index 079be55..4a6138c 100644
--- a/chrome/browser/extensions/api/cookies/cookies_api.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
@@ -170,7 +170,7 @@ bool CookiesFunction::ParseStoreContext(
Profile* store_profile = NULL;
if (!store_id->empty()) {
store_profile = cookies_helpers::ChooseProfileFromStoreId(
- *store_id, profile(), include_incognito());
+ *store_id, GetProfile(), include_incognito());
if (!store_profile) {
error_ = ErrorUtils::FormatErrorMessage(
keys::kInvalidStoreIdError, *store_id);
@@ -513,13 +513,13 @@ void CookiesRemoveFunction::RespondOnUIThread() {
}
bool CookiesGetAllCookieStoresFunction::RunImpl() {
- Profile* original_profile = profile();
+ Profile* original_profile = GetProfile();
DCHECK(original_profile);
scoped_ptr<base::ListValue> original_tab_ids(new base::ListValue());
Profile* incognito_profile = NULL;
scoped_ptr<base::ListValue> incognito_tab_ids;
- if (include_incognito() && profile()->HasOffTheRecordProfile()) {
- incognito_profile = profile()->GetOffTheRecordProfile();
+ if (include_incognito() && GetProfile()->HasOffTheRecordProfile()) {
+ incognito_profile = GetProfile()->GetOffTheRecordProfile();
if (incognito_profile)
incognito_tab_ids.reset(new base::ListValue());
}
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.h b/chrome/browser/extensions/api/cookies/cookies_api.h
index 8dbc0a4..38e7438 100644
--- a/chrome/browser/extensions/api/cookies/cookies_api.h
+++ b/chrome/browser/extensions/api/cookies/cookies_api.h
@@ -14,8 +14,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
+#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/browser/extensions/event_router.h"
-#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/net/chrome_cookie_notification_details.h"
#include "chrome/common/extensions/api/cookies.h"
#include "content/public/browser/notification_observer.h"
@@ -67,7 +67,7 @@ class CookiesEventRouter : public content::NotificationObserver {
// concurrently accessed from multiple threads. They modify |result_| and other
// member variables directly.
// See chrome/browser/extensions/extension_function.h for more information.
-class CookiesFunction : public AsyncExtensionFunction {
+class CookiesFunction : public ChromeAsyncExtensionFunction {
protected:
virtual ~CookiesFunction() {}