summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/gaia
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-19 02:52:53 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-19 02:52:53 +0000
commit6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c (patch)
treea75584b11b8ef188b4eb3376b9146e063823a916 /chrome/browser/net/gaia
parentbf3ee201c1ca5112f7fd173fc4785aa52920c5c0 (diff)
downloadchromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.zip
chromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.tar.gz
chromium_src-6c2381d5ec28a86536c07dfa4a398a2b6bc1a58c.tar.bz2
Move NotificationObserver, NotificationSource, and NotificationDetails to content/public/browser.
This patch got way bigger than I wanted, but once I moved NotificationDetails, I figured I might as well mvoe the others since they're in the same files. In hindsight, I should have converted a subset of files at a time by leaving a using statement in the header. BUG=98716 TBR=joi git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106196 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/gaia')
-rw-r--r--chrome/browser/net/gaia/gaia_oauth_fetcher.cc20
-rw-r--r--chrome/browser/net/gaia/gaia_oauth_fetcher.h14
-rw-r--r--chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc4
-rw-r--r--chrome/browser/net/gaia/token_service.cc20
-rw-r--r--chrome/browser/net/gaia/token_service.h14
-rw-r--r--chrome/browser/net/gaia/token_service_unittest.cc20
-rw-r--r--chrome/browser/net/gaia/token_service_unittest.h12
7 files changed, 53 insertions, 51 deletions
diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
index 1ab44ce..828ca7f 100644
--- a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
+++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
@@ -22,8 +22,8 @@
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/net/gaia/oauth_request_signer.h"
#include "chrome/common/net/http_return.h"
-#include "content/common/notification_details.h"
-#include "content/common/notification_source.h"
+#include "content/public/browser/notification_details.h"
+#include "content/public/browser/notification_source.h"
#include "grit/chromium_strings.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_context_getter.h"
@@ -309,7 +309,7 @@ void GaiaOAuthFetcher::StartGetOAuthToken() {
fetch_pending_ = true;
registrar_.Add(this,
chrome::NOTIFICATION_COOKIE_CHANGED,
- Source<Profile>(profile_));
+ content::Source<Profile>(profile_));
Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
DCHECK(browser);
@@ -324,7 +324,7 @@ void GaiaOAuthFetcher::StartGetOAuthToken() {
DCHECK(popup_ && popup_ != browser);
registrar_.Add(this,
chrome::NOTIFICATION_BROWSER_CLOSING,
- Source<Browser>(popup_));
+ content::Source<Browser>(popup_));
}
void GaiaOAuthFetcher::StartOAuthLogin(
@@ -481,17 +481,17 @@ GoogleServiceAuthError GaiaOAuthFetcher::GenerateAuthError(
}
void GaiaOAuthFetcher::Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
switch (type) {
case chrome::NOTIFICATION_COOKIE_CHANGED: {
- OnCookieChanged(Source<Profile>(source).ptr(),
- Details<ChromeCookieDetails>(details).ptr());
+ OnCookieChanged(content::Source<Profile>(source).ptr(),
+ content::Details<ChromeCookieDetails>(details).ptr());
break;
}
case chrome::NOTIFICATION_BROWSER_CLOSING: {
- OnBrowserClosing(Source<Browser>(source).ptr(),
- *(Details<bool>(details)).ptr());
+ OnBrowserClosing(content::Source<Browser>(source).ptr(),
+ *(content::Details<bool>(details)).ptr());
break;
}
default: {
diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.h b/chrome/browser/net/gaia/gaia_oauth_fetcher.h
index c77f670..77830b2 100644
--- a/chrome/browser/net/gaia/gaia_oauth_fetcher.h
+++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.h
@@ -12,8 +12,8 @@
#include "chrome/browser/net/chrome_cookie_notification_details.h"
#include "chrome/browser/net/gaia/gaia_oauth_consumer.h"
#include "content/common/net/url_fetcher.h"
-#include "content/common/notification_observer.h"
-#include "content/common/notification_registrar.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "googleurl/src/gurl.h"
struct ChromeCookieDetails;
@@ -39,7 +39,7 @@ class Profile;
// This class can handle one request at a time, and all calls through an
// instance should be serialized.
class GaiaOAuthFetcher : public URLFetcher::Delegate,
- public NotificationObserver {
+ public content::NotificationObserver {
public:
// Defines steps of OAuth process performed by this class.
typedef enum {
@@ -115,10 +115,10 @@ class GaiaOAuthFetcher : public URLFetcher::Delegate,
// StartOAuthWrapBridge).
virtual void StartOAuthRevokeWrapToken(const std::string& token);
- // NotificationObserver implementation.
+ // content::NotificationObserver implementation.
virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
// Called when a cookie, e. g. oauth_token, changes
virtual void OnCookieChanged(Profile* profile,
@@ -243,7 +243,7 @@ class GaiaOAuthFetcher : public URLFetcher::Delegate,
net::URLRequestContextGetter* const getter_;
Profile* profile_;
Browser* popup_;
- NotificationRegistrar registrar_;
+ content::NotificationRegistrar registrar_;
// While a fetch is going on:
scoped_ptr<URLFetcher> fetcher_;
diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc
index 259e788..48f160c 100644
--- a/chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc
+++ b/chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc
@@ -125,8 +125,8 @@ TEST(GaiaOAuthFetcherTest, GetOAuthToken) {
oauth_fetcher.Observe(
chrome::NOTIFICATION_COOKIE_CHANGED,
- Source<Profile>(&profile),
- Details<ChromeCookieDetails>(cookie_details.get()));
+ content::Source<Profile>(&profile),
+ content::Details<ChromeCookieDetails>(cookie_details.get()));
}
#endif // 0 // Suppressing for now
diff --git a/chrome/browser/net/gaia/token_service.cc b/chrome/browser/net/gaia/token_service.cc
index 0ad60c9..6e546d3 100644
--- a/chrome/browser/net/gaia/token_service.cc
+++ b/chrome/browser/net/gaia/token_service.cc
@@ -13,7 +13,7 @@
#include "chrome/common/net/gaia/gaia_constants.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_service.h"
-#include "content/common/notification_source.h"
+#include "content/public/browser/notification_source.h"
#include "net/url_request/url_request_context_getter.h"
// Unfortunately kNumServices must be defined in the .h.
@@ -81,7 +81,7 @@ void TokenService::Initialize(const char* const source,
registrar_.Add(this,
chrome::NOTIFICATION_TOKEN_UPDATED,
- Source<Profile>(profile));
+ content::Source<Profile>(profile));
}
void TokenService::ResetCredentialsInMemory() {
@@ -230,8 +230,8 @@ void TokenService::FireTokenAvailableNotification(
TokenAvailableDetails details(service, auth_token);
NotificationService::current()->Notify(
chrome::NOTIFICATION_TOKEN_AVAILABLE,
- Source<TokenService>(this),
- Details<const TokenAvailableDetails>(&details));
+ content::Source<TokenService>(this),
+ content::Details<const TokenAvailableDetails>(&details));
}
void TokenService::FireTokenRequestFailedNotification(
@@ -241,8 +241,8 @@ void TokenService::FireTokenRequestFailedNotification(
TokenRequestFailedDetails details(service, error);
NotificationService::current()->Notify(
chrome::NOTIFICATION_TOKEN_REQUEST_FAILED,
- Source<TokenService>(this),
- Details<const TokenRequestFailedDetails>(&details));
+ content::Source<TokenService>(this),
+ content::Details<const TokenRequestFailedDetails>(&details));
}
void TokenService::IssueAuthTokenForTest(const std::string& service,
@@ -317,7 +317,7 @@ void TokenService::OnWebDataServiceRequestDone(WebDataService::Handle h,
NotificationService::current()->Notify(
chrome::NOTIFICATION_TOKEN_LOADING_FINISHED,
- Source<TokenService>(this),
+ content::Source<TokenService>(this),
NotificationService::NoDetails());
}
@@ -408,10 +408,10 @@ void TokenService::LoadTokensIntoMemory(
}
void TokenService::Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
DCHECK_EQ(type, chrome::NOTIFICATION_TOKEN_UPDATED);
TokenAvailableDetails* tok_details =
- Details<TokenAvailableDetails>(details).ptr();
+ content::Details<TokenAvailableDetails>(details).ptr();
OnIssueAuthTokenSuccess(tok_details->service(), tok_details->token());
}
diff --git a/chrome/browser/net/gaia/token_service.h b/chrome/browser/net/gaia/token_service.h
index 39967ad..f7662e5 100644
--- a/chrome/browser/net/gaia/token_service.h
+++ b/chrome/browser/net/gaia/token_service.h
@@ -47,8 +47,8 @@
#include "chrome/common/net/gaia/gaia_auth_consumer.h"
#include "chrome/common/net/gaia/gaia_auth_fetcher.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
-#include "content/common/notification_observer.h"
-#include "content/common/notification_registrar.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
class Profile;
@@ -61,7 +61,7 @@ class URLRequestContextGetter;
class TokenService : public GaiaAuthConsumer,
public GaiaOAuthConsumer,
public WebDataServiceConsumer,
- public NotificationObserver {
+ public content::NotificationObserver {
public:
TokenService();
virtual ~TokenService();
@@ -179,10 +179,10 @@ class TokenService : public GaiaAuthConsumer,
virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
const WDTypedResult* result);
- // NotificationObserver implementation.
+ // content::NotificationObserver implementation.
virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details);
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details);
private:
@@ -245,7 +245,7 @@ class TokenService : public GaiaAuthConsumer,
// Map from service to token.
std::map<std::string, std::string> token_map_;
- NotificationRegistrar registrar_;
+ content::NotificationRegistrar registrar_;
FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic);
FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced);
diff --git a/chrome/browser/net/gaia/token_service_unittest.cc b/chrome/browser/net/gaia/token_service_unittest.cc
index 72994c6..396873f 100644
--- a/chrome/browser/net/gaia/token_service_unittest.cc
+++ b/chrome/browser/net/gaia/token_service_unittest.cc
@@ -19,12 +19,13 @@ TokenAvailableTracker::TokenAvailableTracker() {}
TokenAvailableTracker::~TokenAvailableTracker() {}
-void TokenAvailableTracker::Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
+void TokenAvailableTracker::Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
TestNotificationTracker::Observe(type, source, details);
if (type == chrome::NOTIFICATION_TOKEN_AVAILABLE) {
- Details<const TokenService::TokenAvailableDetails> full = details;
+ content::Details<const TokenService::TokenAvailableDetails> full = details;
details_ = *full.ptr();
}
}
@@ -34,11 +35,12 @@ TokenFailedTracker::TokenFailedTracker() {}
TokenFailedTracker::~TokenFailedTracker() {}
void TokenFailedTracker::Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) {
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
TestNotificationTracker::Observe(type, source, details);
if (type == chrome::NOTIFICATION_TOKEN_REQUEST_FAILED) {
- Details<const TokenService::TokenRequestFailedDetails> full = details;
+ content::Details<const TokenService::TokenRequestFailedDetails> full =
+ details;
details_ = *full.ptr();
}
}
@@ -68,9 +70,9 @@ void TokenServiceTestHarness::SetUp() {
WaitForDBLoadCompletion();
success_tracker_.ListenFor(chrome::NOTIFICATION_TOKEN_AVAILABLE,
- Source<TokenService>(&service_));
+ content::Source<TokenService>(&service_));
failure_tracker_.ListenFor(chrome::NOTIFICATION_TOKEN_REQUEST_FAILED,
- Source<TokenService>(&service_));
+ content::Source<TokenService>(&service_));
service_.Initialize("test", profile_.get());
}
diff --git a/chrome/browser/net/gaia/token_service_unittest.h b/chrome/browser/net/gaia/token_service_unittest.h
index ffb9396..689d3b5 100644
--- a/chrome/browser/net/gaia/token_service_unittest.h
+++ b/chrome/browser/net/gaia/token_service_unittest.h
@@ -14,8 +14,8 @@
#include "chrome/common/net/gaia/gaia_auth_consumer.h"
#include "chrome/test/base/signaling_task.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/common/notification_details.h"
-#include "content/common/notification_source.h"
+#include "content/public/browser/notification_details.h"
+#include "content/public/browser/notification_source.h"
#include "content/test/test_notification_tracker.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -33,8 +33,8 @@ class TokenAvailableTracker : public TestNotificationTracker {
private:
virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details);
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details);
TokenService::TokenAvailableDetails details_;
};
@@ -50,8 +50,8 @@ class TokenFailedTracker : public TestNotificationTracker {
private:
virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details);
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details);
TokenService::TokenRequestFailedDetails details_;
};