| Index: components/translate/core/browser/translate_download_manager.h
|
| diff --git a/components/translate/core/browser/translate_download_manager.h b/components/translate/core/browser/translate_download_manager.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..38b8f87c205aa6823127ff1938b8a182600f94ac
|
| --- /dev/null
|
| +++ b/components/translate/core/browser/translate_download_manager.h
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_TRANSLATE_CORE_BROWER_TRANSLATE_DOWNLOAD_MANAGER_H_
|
| +#define COMPONENTS_TRANSLATE_CORE_BROWER_TRANSLATE_DOWNLOAD_MANAGER_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/logging.h"
|
| +#include "base/memory/ref_counted.h"
|
| +#include "net/url_request/url_request_context_getter.h"
|
| +
|
| +template <typename T> struct DefaultSingletonTraits;
|
| +
|
| +// Manages the downloaded resources for Translate, such as the translate script
|
| +// and the language list.
|
| +// TODO(droger): TranslateDownloadManager should own TranslateLanguageList and
|
| +// TranslateScript.
|
| +class TranslateDownloadManager {
|
| + public:
|
| + // Returns the singleton instance.
|
| + static TranslateDownloadManager* GetInstance();
|
| +
|
| + // The request context used to download the resources.
|
| + net::URLRequestContextGetter* request_context() { return request_context_; }
|
| + void set_request_context(net::URLRequestContextGetter* context) {
|
| + request_context_ = context;
|
| + }
|
| +
|
| + // The application locale.
|
| + const std::string& application_locale() { return application_locale_; }
|
| + void set_application_locale(const std::string& locale) {
|
| + application_locale_ = locale;
|
| + }
|
| +
|
| + private:
|
| + friend struct DefaultSingletonTraits<TranslateDownloadManager>;
|
| + TranslateDownloadManager();
|
| + virtual ~TranslateDownloadManager();
|
| +
|
| + std::string application_locale_;
|
| + scoped_refptr<net::URLRequestContextGetter> request_context_;
|
| +};
|
| +
|
| +#endif // COMPONENTS_TRANSLATE_CORE_BROWER_TRANSLATE_DOWNLOAD_MANAGER_H_
|
|
|