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

Unified Diff: chrome/browser/invalidation/gcm_network_channel_delegate_impl.h

Issue 186623006: Refactor GCMNetworkChannelDelegateImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another rebase to resolve conflict with recent change. 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/invalidation/gcm_network_channel_delegate_impl.h
diff --git a/chrome/browser/invalidation/gcm_network_channel_delegate_impl.h b/chrome/browser/invalidation/gcm_network_channel_delegate_impl.h
deleted file mode 100644
index 20a9cb54d64ceabf2e6ff0284da412885b570ef2..0000000000000000000000000000000000000000
--- a/chrome/browser/invalidation/gcm_network_channel_delegate_impl.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_INVALIDATION_GCM_NETWORK_CHANNEL_DELEGATE_IMPL_H_
-#define CHROME_BROWSER_INVALIDATION_GCM_NETWORK_CHANNEL_DELEGATE_IMPL_H_
-
-#include "google_apis/gaia/oauth2_token_service.h"
-#include "sync/notifier/gcm_network_channel_delegate.h"
-
-class Profile;
-
-namespace base {
-class SingleThreadTaskRunner;
-} // namespace base
-
-namespace invalidation {
-
-// Implementation of GCMNetworkChannelDelegate.
-// GCMNetworkChannel lives in sync/notifier and therefore doesn't have access to
-// ProfileOAuth2TokenService and GCMPRofileService that it needs.
-// GCMNetworkChannelDelegate declares abstract interface for these functions
-// which GCMNetworkChannelDelegateImpl implements in chrome/browser/invalidation
-// where it has access to BrowserContext keyed services.
-class GCMNetworkChannelDelegateImpl : public syncer::GCMNetworkChannelDelegate,
- public OAuth2TokenService::Consumer {
- public:
- explicit GCMNetworkChannelDelegateImpl(Profile* profile);
- virtual ~GCMNetworkChannelDelegateImpl();
-
- // GCMNetworkChannelDelegate implementation.
- virtual void Register(RegisterCallback callback) OVERRIDE;
- virtual void RequestToken(RequestTokenCallback callback) OVERRIDE;
- virtual void InvalidateToken(const std::string& token) OVERRIDE;
-
- // OAuth2TokenService::Consumer implementation.
- virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
- const std::string& access_token,
- const base::Time& expiration_time) OVERRIDE;
- virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
- const GoogleServiceAuthError& error) OVERRIDE;
-
- private:
- static void InvalidateTokenOnUIThread(Profile* profile,
- const std::string& token);
-
- Profile* profile_;
- scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_;
-
- // Fields related to RequestToken function.
- std::string account_id_;
- scoped_ptr<OAuth2TokenService::Request> access_token_request_;
- RequestTokenCallback request_token_callback_;
-};
-
-} // namespace invalidation
-
-#endif // CHROME_BROWSER_INVALIDATION_GCM_NETWORK_CHANNEL_DELEGATE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698