OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_ |
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "net/url_request/url_fetcher_delegate.h" | 10 #include "net/url_request/url_fetcher_delegate.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
| 13 namespace translate { |
| 14 |
13 // Downloads raw Translate data such as the Translate script and the language | 15 // Downloads raw Translate data such as the Translate script and the language |
14 // list. | 16 // list. |
15 class TranslateURLFetcher : public net::URLFetcherDelegate { | 17 class TranslateURLFetcher : public net::URLFetcherDelegate { |
16 public: | 18 public: |
17 // Callback type for Request(). | 19 // Callback type for Request(). |
18 typedef base::Callback<void(int, bool, const std::string&)> Callback; | 20 typedef base::Callback<void(int, bool, const std::string&)> Callback; |
19 | 21 |
20 // Represents internal state if the fetch is completed successfully. | 22 // Represents internal state if the fetch is completed successfully. |
21 enum State { | 23 enum State { |
22 IDLE, // No fetch request was issued. | 24 IDLE, // No fetch request was issued. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 78 |
77 // Max number how many times to retry on the server error | 79 // Max number how many times to retry on the server error |
78 int max_retry_on_5xx_; | 80 int max_retry_on_5xx_; |
79 | 81 |
80 // An extra HTTP request header | 82 // An extra HTTP request header |
81 std::string extra_request_header_; | 83 std::string extra_request_header_; |
82 | 84 |
83 DISALLOW_COPY_AND_ASSIGN(TranslateURLFetcher); | 85 DISALLOW_COPY_AND_ASSIGN(TranslateURLFetcher); |
84 }; | 86 }; |
85 | 87 |
| 88 } // namespace translate |
| 89 |
86 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_ | 90 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_URL_FETCHER_H_ |
OLD | NEW |