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

Unified Diff: chrome/browser/local_discovery/gcd_api_flow.h

Issue 318283002: Added new GCD/Privet interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/local_discovery/gcd_api_flow.h
diff --git a/chrome/browser/local_discovery/gcd_api_flow.h b/chrome/browser/local_discovery/gcd_api_flow.h
index 492e178a19abaae5c256314c8d3262e0b4d84655..07c9ce437cff3fe2019b9e07e0f7a18e5ae980fb 100644
--- a/chrome/browser/local_discovery/gcd_api_flow.h
+++ b/chrome/browser/local_discovery/gcd_api_flow.h
@@ -17,8 +17,7 @@
namespace local_discovery {
// API flow for communicating with cloud print and cloud devices.
-class GCDApiFlow : public net::URLFetcherDelegate,
- public OAuth2TokenService::Consumer {
+class GCDApiFlowInterface {
Noam Samuel 2014/06/09 17:53:22 Isn't it more common to write GCDApiFlow and GCDAp
public:
// TODO(noamsml): Better error model for this class.
enum Status {
@@ -57,15 +56,27 @@ class GCDApiFlow : public net::URLFetcherDelegate,
DISALLOW_COPY_AND_ASSIGN(Request);
};
+ GCDApiFlowInterface();
+ virtual ~GCDApiFlowInterface();
+
+ virtual void Start(scoped_ptr<Request> request) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GCDApiFlowInterface);
+};
+
+class GCDApiFlow : public GCDApiFlowInterface,
+ public net::URLFetcherDelegate,
+ public OAuth2TokenService::Consumer {
+ public:
// Create an OAuth2-based confirmation.
GCDApiFlow(net::URLRequestContextGetter* request_context,
OAuth2TokenService* token_service,
- const std::string& account_id,
- scoped_ptr<Request> request);
+ const std::string& account_id);
virtual ~GCDApiFlow();
- void Start();
+ virtual void Start(scoped_ptr<Request> request) OVERRIDE;
// net::URLFetcherDelegate implementation:
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
@@ -86,10 +97,11 @@ class GCDApiFlow : public net::URLFetcherDelegate,
OAuth2TokenService* token_service_;
std::string account_id_;
scoped_ptr<Request> request_;
+
DISALLOW_COPY_AND_ASSIGN(GCDApiFlow);
};
-class GCDApiFlowRequest : public GCDApiFlow::Request {
+class GCDApiFlowRequest : public GCDApiFlowInterface::Request {
public:
GCDApiFlowRequest();
virtual ~GCDApiFlowRequest();
@@ -102,7 +114,7 @@ class GCDApiFlowRequest : public GCDApiFlow::Request {
DISALLOW_COPY_AND_ASSIGN(GCDApiFlowRequest);
};
-class CloudPrintApiFlowRequest : public GCDApiFlow::Request {
+class CloudPrintApiFlowRequest : public GCDApiFlowInterface::Request {
public:
CloudPrintApiFlowRequest();
virtual ~CloudPrintApiFlowRequest();
« no previous file with comments | « chrome/browser/local_discovery/cloud_print_printer_list.cc ('k') | chrome/browser/local_discovery/gcd_api_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698