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/24 17:52:43
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 net::URLRequestContextGetter* request_context() { return request_context_; } | |
| 27 void set_request_context(net::URLRequestContextGetter* context) { | |
|
blundell
2014/01/24 17:52:43
Does this have to be set before anything can be do
| |
| 28 request_context_ = context; | |
| 29 } | |
| 30 | |
| 31 // The application locale. | |
| 32 const std::string& application_locale() { return application_locale_; } | |
| 33 void set_application_locale(const std::string& locale) { | |
|
blundell
2014/01/24 17:52:43
Same question as above.
| |
| 34 application_locale_ = locale; | |
| 35 } | |
| 36 | |
| 37 private: | |
| 38 friend struct DefaultSingletonTraits<TranslateDownloadManager>; | |
| 39 TranslateDownloadManager(); | |
| 40 virtual ~TranslateDownloadManager(); | |
| 41 | |
| 42 std::string application_locale_; | |
| 43 scoped_refptr<net::URLRequestContextGetter> request_context_; | |
| 44 }; | |
| 45 | |
| 46 #endif // COMPONENTS_TRANSLATE_CORE_BROWER_TRANSLATE_DOWNLOAD_MANAGER_H_ | |
| OLD | NEW |