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

Side by Side Diff: chrome/browser/local_discovery/privetv2_session.h

Issue 305533007: Rename PrivetV2 to PrivetV3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privetv2_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV2_SESSION_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV2_SESSION_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/values.h"
13
14 namespace local_discovery {
15
16 class PrivetHTTPClient;
17
18 class PrivetV2Session {
19 public:
20 typedef base::Callback<
21 void(bool success, const base::DictionaryValue& response)>
22 RequestCallback;
23
24 class Delegate {
25 public:
26 typedef base::Callback<void(bool confirm)> ConfirmationCallback;
27
28 virtual ~Delegate() {}
29
30 virtual void OnSetupConfirmationNeeded(
31 const std::string& confirmation_code,
32 const ConfirmationCallback& callback) = 0;
33
34 virtual void OnSessionEstablished() = 0;
35
36 virtual void OnCannotEstablishSession() = 0;
37 };
38
39 class Request {
40 public:
41 virtual ~Request() {}
42
43 virtual void Start() = 0;
44 };
45
46 virtual ~PrivetV2Session() {}
47
48 static scoped_ptr<PrivetV2Session> Create(PrivetHTTPClient* client);
49
50 // Establish a session, will call |OnSetupConfirmationNeeded| and then
51 // |OnSessionEstablished|.
52 virtual void Start() = 0;
53
54 // Create a single /privet/v2/session/call request.
55 virtual scoped_ptr<Request> CreateRequest(
56 const char* api_name,
57 const base::DictionaryValue& request,
58 const RequestCallback& callback);
59 };
60
61 } // namespace local_discovery
62
63 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV2_SESSION_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privetv2_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698