OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/policy/testing_policy_url_fetcher_factory.h" | 5 #include "chrome/browser/policy/testing_policy_url_fetcher_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/policy/logging_work_scheduler.h" | 8 #include "chrome/browser/policy/logging_work_scheduler.h" |
9 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 9 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 } | 29 } |
30 return ""; | 30 return ""; |
31 } | 31 } |
32 | 32 |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 namespace policy { | 35 namespace policy { |
36 | 36 |
37 // An URLFetcher that calls back to its factory to figure out what to respond. | 37 // An URLFetcher that calls back to its factory to figure out what to respond. |
38 class TestingPolicyURLFetcher : public TestURLFetcher { | 38 class TestingPolicyURLFetcher : public net::TestURLFetcher { |
39 public: | 39 public: |
40 TestingPolicyURLFetcher( | 40 TestingPolicyURLFetcher( |
41 const base::WeakPtr<TestingPolicyURLFetcherFactory>& parent, | 41 const base::WeakPtr<TestingPolicyURLFetcherFactory>& parent, |
42 const GURL& url, | 42 const GURL& url, |
43 net::URLFetcherDelegate* delegate); | 43 net::URLFetcherDelegate* delegate); |
44 | 44 |
45 virtual void Start() OVERRIDE; | 45 virtual void Start() OVERRIDE; |
46 void Respond(); | 46 void Respond(); |
47 | 47 |
48 virtual int GetResponseCode() const OVERRIDE { | 48 virtual int GetResponseCode() const OVERRIDE { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 net::URLFetcher* TestingPolicyURLFetcherFactory::CreateURLFetcher( | 125 net::URLFetcher* TestingPolicyURLFetcherFactory::CreateURLFetcher( |
126 int id, | 126 int id, |
127 const GURL& url, | 127 const GURL& url, |
128 net::URLFetcher::RequestType request_type, | 128 net::URLFetcher::RequestType request_type, |
129 net::URLFetcherDelegate* delegate) { | 129 net::URLFetcherDelegate* delegate) { |
130 return new TestingPolicyURLFetcher( | 130 return new TestingPolicyURLFetcher( |
131 weak_ptr_factory_.GetWeakPtr(), url, delegate); | 131 weak_ptr_factory_.GetWeakPtr(), url, delegate); |
132 } | 132 } |
133 | 133 |
134 } // namespace policy | 134 } // namespace policy |
OLD | NEW |