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

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

Issue 159883002: Move TranslatePrefs to the Translate component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceptLanguages
Patch Set: Fix typo Created 6 years, 10 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_tab_helper.h
diff --git a/chrome/browser/translate/translate_tab_helper.h b/chrome/browser/translate/translate_tab_helper.h
index 6348cd2c621ba2d05bbcf8acdfe70981340e0ef7..2a54373fabf40adc176ef5a82a02efbd5570e79d 100644
--- a/chrome/browser/translate/translate_tab_helper.h
+++ b/chrome/browser/translate/translate_tab_helper.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/translate/translate_bubble_model.h"
#include "components/translate/content/browser/content_translate_driver.h"
#include "components/translate/core/common/translate_errors.h"
@@ -14,10 +15,13 @@
#include "content/public/browser/web_contents_user_data.h"
namespace content {
+class BrowserContext;
class WebContents;
}
struct LanguageDetectionDetails;
+class PrefService;
+class TranslatePrefs;
class TranslateTabHelper
: public content::WebContentsObserver,
@@ -32,6 +36,15 @@ class TranslateTabHelper
// WebContents.
ContentTranslateDriver& translate_driver() { return translate_driver_; }
+ // Helper method to return a new TranslatePrefs instance.
+ static scoped_ptr<TranslatePrefs> CreateTranslatePrefs(PrefService* prefs);
+
+ // Returns true if the passed language has been configured by the user as an
+ // accept language. |language| will be converted if it has the synonym of
blundell 2014/02/12 14:01:43 I don't understand the second sentence here.
+ // accept languages.
+ static bool IsAcceptLanguage(content::BrowserContext* browser_context,
+ const std::string& language);
+
// Denotes which state the user is in with respect to translate.
enum TranslateStep {
BEFORE_TRANSLATE,

Powered by Google App Engine
This is Rietveld 408576698