Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1760)

Unified Diff: chrome/browser/translate/translate_manager.h

Issue 15317007: Translate: split supporting language list handling to TranslateLanguageList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/translate/translate_manager.h
diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h
index 5a243782fb136028aa95d4c5399c8824b8bcefa5..effdea5562900dfa0c17faecbc0d574a22bc6191 100644
--- a/chrome/browser/translate/translate_manager.h
+++ b/chrome/browser/translate/translate_manager.h
@@ -11,7 +11,6 @@
#include <vector>
#include "base/gtest_prod_util.h"
-#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/prefs/pref_change_registrar.h"
@@ -50,9 +49,8 @@ class TranslateManager : public content::NotificationObserver,
virtual ~TranslateManager();
// Let the caller decide if and when we should fetch the language list from
- // the translate server. This is a NOOP if switches::kDisableTranslate is
- // set or if prefs::kEnableTranslate is set to false.
- // It will not retry more than kMaxRetryLanguageListFetch times.
+ // the translate server. This is a NOOP if switches::kDisableTranslate is set
+ // or if prefs::kEnableTranslate is set to false.
void FetchLanguageListFromTranslateServer(PrefService* prefs);
// Allows caller to cleanup pending URLFetcher objects to make sure they
@@ -102,20 +100,6 @@ class TranslateManager : public content::NotificationObserver,
// Returns true if the URL can be translated.
static bool IsTranslatableURL(const GURL& url);
- // Fills |languages| with the list of languages that the translate server can
- // translate to and from.
- static void GetSupportedLanguages(std::vector<std::string>* languages);
-
- // Returns the language code that can be used with the Translate method for a
- // specified |chrome_locale|.
- static std::string GetLanguageCode(const std::string& chrome_locale);
-
- // Returns true if |language| is supported by the translation server.
- static bool IsSupportedLanguage(const std::string& language);
-
- // static const values shared with our browser tests.
- static const char kLanguageListCallbackName[];
- static const char kTargetLanguagesKey[];
protected:
TranslateManager();
@@ -133,14 +117,6 @@ class TranslateManager : public content::NotificationObserver,
std::string target_lang;
};
- // Fills supported_languages_ with the list of languages that the translate
- // server can translate to and from.
- static void SetSupportedLanguages(const std::string& language_list);
-
- // Initializes the list of supported languages if it wasn't initialized before
- // in case we failed to get them from the server, or didn't get them just yet.
- static void InitSupportedLanguages();
-
// Starts the translation process on |tab| containing the page in the
// |page_lang| language.
void InitiateTranslation(content::WebContents* web_contents,
@@ -213,18 +189,11 @@ class TranslateManager : public content::NotificationObserver,
// Set when the translate JS is currently being retrieved. NULL otherwise.
scoped_ptr<net::URLFetcher> translate_script_request_pending_;
- // Set when the list of languages is currently being retrieved.
- // NULL otherwise.
- scoped_ptr<net::URLFetcher> language_list_request_pending_;
-
// The list of pending translate requests. Translate requests are queued when
// the translate script is not ready and has to be fetched from the translate
// server.
std::vector<PendingRequest> pending_requests_;
- // The languages supported by the translation server.
- static base::LazyInstance<std::set<std::string> > supported_languages_;
-
DISALLOW_COPY_AND_ASSIGN(TranslateManager);
};

Powered by Google App Engine
This is Rietveld 408576698