Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWER_TRANSLATE_DOWNLOAD_MANAGER_H_ | |
| 6 #define COMPONENTS_TRANSLATE_CORE_BROWER_TRANSLATE_DOWNLOAD_MANAGER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/logging.h" | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "net/url_request/url_request_context_getter.h" | |
| 13 | |
| 14 template <typename T> struct DefaultSingletonTraits; | |
| 15 | |
| 16 // Manages the downloaded resources for Translate, such as the translate script | |
| 17 // and the language list. | |
| 18 // TODO(droger): TranslateDownloadManager should own TranslateLanguageList and | |
| 19 // TranslateScript. | |
|
blundell
2014/01/27 16:02:33
bug?
| |
| 20 class TranslateDownloadManager { | |
| 21 public: | |
| 22 // Returns the singleton instance. | |
| 23 static TranslateDownloadManager* GetInstance(); | |
| 24 | |
| 25 // The request context used to download the resources. | |
| 26 // Should be set before this class can be used. | |
|
blundell
2014/01/27 16:02:33
Can we DCHECK this "should" and the one below?
droger
2014/01/28 14:16:48
Done for the application locale.
Tests use a NULL
| |
| 27 net::URLRequestContextGetter* request_context() { return request_context_; } | |
| 28 void set_request_context(net::URLRequestContextGetter* context) { | |
| 29 request_context_ = context; | |
| 30 } | |
| 31 | |
| 32 // The application locale. | |
| 33 // Should be set before this class can be used. | |
| 34 const std::string& application_locale() { return application_locale_; } | |
| 35 void set_application_locale(const std::string& locale) { | |
| 36 application_locale_ = locale; | |
| 37 } | |
| 38 | |
| 39 private: | |
| 40 friend struct DefaultSingletonTraits<TranslateDownloadManager>; | |
| 41 TranslateDownloadManager(); | |
| 42 virtual ~TranslateDownloadManager(); | |
| 43 | |
| 44 std::string application_locale_; | |
| 45 scoped_refptr<net::URLRequestContextGetter> request_context_; | |
| 46 }; | |
| 47 | |
| 48 #endif // COMPONENTS_TRANSLATE_CORE_BROWER_TRANSLATE_DOWNLOAD_MANAGER_H_ | |
| OLD | NEW |