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

Unified Diff: chrome/browser/extensions/api/copresence/copresence_api.h

Issue 441103002: Tests for the Copresence API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@api
Patch Set: Renaming to simply CopresenceDelegate Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/copresence/copresence_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/copresence/copresence_api.h
diff --git a/chrome/browser/extensions/api/copresence/copresence_api.h b/chrome/browser/extensions/api/copresence/copresence_api.h
index 741d2c40b6593365ca89cad15aa5eb2a176aada0..83fb5dbdb7067c1b9beb5cd25e0515a636ff9410 100644
--- a/chrome/browser/extensions/api/copresence/copresence_api.h
+++ b/chrome/browser/extensions/api/copresence/copresence_api.h
@@ -14,18 +14,18 @@
#include "chrome/browser/extensions/api/copresence/copresence_translations.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/common/extensions/api/copresence.h"
-#include "components/copresence/public/copresence_client_delegate.h"
+#include "components/copresence/public/copresence_delegate.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
namespace copresence {
-class CopresenceClient;
+class CopresenceManager;
class WhispernetClient;
}
namespace extensions {
class CopresenceService : public BrowserContextKeyedAPI,
- public copresence::CopresenceClientDelegate {
+ public copresence::CopresenceDelegate {
public:
explicit CopresenceService(content::BrowserContext* context);
virtual ~CopresenceService();
@@ -33,9 +33,9 @@ class CopresenceService : public BrowserContextKeyedAPI,
// BrowserContextKeyedAPI implementation.
virtual void Shutdown() OVERRIDE;
- // These accessors will always return an object. If the object doesn't exist,
- // they will create one first.
- copresence::CopresenceClient* client();
+ // These accessors will always return an object (except during shutdown).
+ // If the object doesn't exist, they will create one first.
+ copresence::CopresenceManager* manager();
copresence::WhispernetClient* whispernet_client();
// A registry containing the app id's associated with every subscription.
@@ -45,13 +45,17 @@ class CopresenceService : public BrowserContextKeyedAPI,
void set_api_key(const std::string& api_key) { api_key_ = api_key; }
+ // Manager override for testing.
+ void set_manager_for_testing(
+ scoped_ptr<copresence::CopresenceManager> manager);
+
// BrowserContextKeyedAPI implementation.
static BrowserContextKeyedAPIFactory<CopresenceService>* GetFactoryInstance();
private:
friend class BrowserContextKeyedAPIFactory<CopresenceService>;
- // CopresenceClientDelegate overrides:
+ // CopresenceDelegate implementation
virtual void HandleMessages(
const std::string& app_id,
const std::string& subscription_id,
@@ -70,7 +74,7 @@ class CopresenceService : public BrowserContextKeyedAPI,
content::BrowserContext* const browser_context_;
std::string api_key_;
- scoped_ptr<copresence::CopresenceClient> client_;
+ scoped_ptr<copresence::CopresenceManager> manager_;
scoped_ptr<copresence::WhispernetClient> whispernet_client_;
DISALLOW_COPY_AND_ASSIGN(CopresenceService);
« no previous file with comments | « no previous file | chrome/browser/extensions/api/copresence/copresence_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698