OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
6 #define CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/atomicops.h" | 12 #include "base/atomicops.h" |
13 #include "base/lock.h" | 13 #include "base/lock.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "chrome/browser/sync/syncable/syncable_id.h" | 17 #include "chrome/browser/sync/syncable/syncable_id.h" |
18 #include "chrome/browser/sync/util/sync_types.h" | 18 #include "chrome/browser/sync/util/sync_types.h" |
19 #include "chrome/common/deprecated/event_sys.h" | 19 #include "chrome/common/deprecated/event_sys.h" |
20 #include "chrome/common/net/http_return.h" | 20 #include "chrome/common/net/http_return.h" |
21 #include "chrome/common/net/gaia/signin.h" | |
22 | 21 |
23 namespace syncable { | 22 namespace syncable { |
24 class WriteTransaction; | 23 class WriteTransaction; |
25 class DirectoryManager; | 24 class DirectoryManager; |
26 } | 25 } |
27 | 26 |
28 namespace sync_pb { | 27 namespace sync_pb { |
29 class ClientToServerMessage; | 28 class ClientToServerMessage; |
30 } | 29 } |
31 | 30 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 inline std::string user_agent() const { return user_agent_; } | 246 inline std::string user_agent() const { return user_agent_; } |
248 | 247 |
249 inline HttpResponse::ServerConnectionCode server_status() const { | 248 inline HttpResponse::ServerConnectionCode server_status() const { |
250 return server_status_; | 249 return server_status_; |
251 } | 250 } |
252 | 251 |
253 inline bool server_reachable() const { return server_reachable_; } | 252 inline bool server_reachable() const { return server_reachable_; } |
254 | 253 |
255 const std::string client_id() const { return client_id_; } | 254 const std::string client_id() const { return client_id_; } |
256 | 255 |
257 void SetDomainFromSignIn(gaia::SignIn signin_type, const std::string& signin); | |
258 | |
259 // This changes the server info used by the connection manager. This allows | 256 // This changes the server info used by the connection manager. This allows |
260 // a single client instance to talk to different backing servers. This is | 257 // a single client instance to talk to different backing servers. This is |
261 // typically called during / after authentication so that the server url | 258 // typically called during / after authentication so that the server url |
262 // can be a function of the user's login id. A side effect of this call is | 259 // can be a function of the user's login id. A side effect of this call is |
263 // that ResetConnection is called. | 260 // that ResetConnection is called. |
264 void SetServerParameters(const std::string& server_url, | 261 void SetServerParameters(const std::string& server_url, |
265 int port, | 262 int port, |
266 bool use_ssl); | 263 bool use_ssl); |
267 | 264 |
268 // Returns the current server parameters in server_url, port and use_ssl. | 265 // Returns the current server parameters in server_url, port and use_ssl. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, | 371 bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, |
375 syncable::DirectoryManager* manager, | 372 syncable::DirectoryManager* manager, |
376 const std::string& share); | 373 const std::string& share); |
377 | 374 |
378 } // namespace browser_sync | 375 } // namespace browser_sync |
379 | 376 |
380 std::ostream& operator<<(std::ostream& s, | 377 std::ostream& operator<<(std::ostream& s, |
381 const struct browser_sync::HttpResponse& hr); | 378 const struct browser_sync::HttpResponse& hr); |
382 | 379 |
383 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 380 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
OLD | NEW |