Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / test / test_http_bridge_factory.h
blob145d1464ebf6c02f24c07d02163fa2a9d5c029e8
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_
6 #define CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_
8 #include "base/compiler_specific.h"
9 #include "sync/internal_api/public/http_post_provider_factory.h"
10 #include "sync/internal_api/public/http_post_provider_interface.h"
12 namespace browser_sync {
14 class TestHttpBridge : public syncer::HttpPostProviderInterface {
15 public:
16 // Begin syncer::HttpPostProviderInterface implementation:
17 virtual void SetExtraRequestHeaders(const char * headers) OVERRIDE {}
19 virtual void SetURL(const char* url, int port) OVERRIDE {}
21 virtual void SetPostPayload(const char* content_type,
22 int content_length,
23 const char* content) OVERRIDE {}
25 virtual bool MakeSynchronousPost(int* error_code,
26 int* response_code) OVERRIDE;
28 virtual int GetResponseContentLength() const OVERRIDE;
30 virtual const char* GetResponseContent() const OVERRIDE;
32 virtual const std::string GetResponseHeaderValue(
33 const std::string&) const OVERRIDE;
35 virtual void Abort() OVERRIDE;
36 // End syncer::HttpPostProviderInterface implementation.
39 class TestHttpBridgeFactory : public syncer::HttpPostProviderFactory {
40 public:
41 TestHttpBridgeFactory();
42 virtual ~TestHttpBridgeFactory();
44 // syncer::HttpPostProviderFactory:
45 virtual void Init(const std::string& user_agent) OVERRIDE;
46 virtual syncer::HttpPostProviderInterface* Create() OVERRIDE;
47 virtual void Destroy(syncer::HttpPostProviderInterface* http) OVERRIDE;
50 } // namespace browser_sync
52 #endif // CHROME_BROWSER_SYNC_TEST_TEST_HTTP_BRIDGE_FACTORY_H_