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

Side by Side Diff: chrome/service/remoting/remoting_directory_service.h

Issue 6036001: Move directory code from chrome/service to chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merges Created 10 years 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 | « chrome/common/net/http_return.h ('k') | chrome/service/remoting/remoting_directory_service.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 (c) 2010 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_SERVICE_REMOTING_REMOTING_DIRECTORY_SERVICE_H_
6 #define CHROME_SERVICE_REMOTING_REMOTING_DIRECTORY_SERVICE_H_
7
8 #include <string>
9
10 #include "base/scoped_ptr.h"
11 #include "chrome/common/net/url_fetcher.h"
12 #include "googleurl/src/gurl.h"
13
14 namespace remoting {
15 class HostKeyPair;
16 } // namespace remoting
17
18 // A class to provide access to the remoting directory service.
19 // TODO(hclam): Should implement this in Javascript.
20 class RemotingDirectoryService : public URLFetcher::Delegate {
21 public:
22 // Client to receive events from the directory service.
23 class Client {
24 public:
25 virtual ~Client() {}
26
27 // Called when a remoting host was added.
28 virtual void OnRemotingHostAdded() {}
29
30 // Called when the last operation has failed.
31 virtual void OnRemotingDirectoryError() {}
32 };
33
34 explicit RemotingDirectoryService(Client* client);
35 ~RemotingDirectoryService();
36
37 // Add this computer as host. Use the token for authentication.
38 // TODO(hclam): Need more information for this method call.
39 void AddHost(const std::string& token);
40
41 // Cancel the last requested operation.
42 void CancelRequest();
43
44 // URLFetcher::Delegate implementation.
45 virtual void OnURLFetchComplete(const URLFetcher* source,
46 const GURL& url,
47 const URLRequestStatus& status,
48 int response_code,
49 const ResponseCookies& cookies,
50 const std::string& data);
51
52 const std::string& host_id() const { return host_id_; }
53 const std::string& host_name() const { return host_name_; }
54 remoting::HostKeyPair* host_key_pair() const {
55 return host_key_pair_.get();
56 }
57
58 private:
59 Client* client_;
60 scoped_ptr<URLFetcher> fetcher_;
61
62 // Host key generated during host registration.
63 scoped_ptr<remoting::HostKeyPair> host_key_pair_;
64
65 // Host info used for registration.
66 std::string host_id_;
67 std::string host_name_;
68
69 DISALLOW_COPY_AND_ASSIGN(RemotingDirectoryService);
70 };
71
72 #endif // CHROME_SERVICE_REMOTING_REMOTING_DIRECTORY_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/common/net/http_return.h ('k') | chrome/service/remoting/remoting_directory_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698