Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ | 6 #define CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 // Returns the ContentTranslateDriver instance associated with this | 49 // Returns the ContentTranslateDriver instance associated with this |
| 50 // WebContents. | 50 // WebContents. |
| 51 translate::ContentTranslateDriver& translate_driver() { | 51 translate::ContentTranslateDriver& translate_driver() { |
| 52 return translate_driver_; | 52 return translate_driver_; |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Helper method to return a new TranslatePrefs instance. | 55 // Helper method to return a new TranslatePrefs instance. |
| 56 static scoped_ptr<translate::TranslatePrefs> CreateTranslatePrefs( | 56 static scoped_ptr<translate::TranslatePrefs> CreateTranslatePrefs( |
| 57 PrefService* prefs); | 57 PrefService* prefs); |
| 58 | 58 |
| 59 // Helper method to force an override of | |
| 60 // kVariationsPermanentConsistencyCountry. Returns true if the variable has | |
|
Alexei Svitkine (slow)
2016/04/20 20:30:23
Nit: No need to say "Helper method". Also, the pre
hamelphi
2016/04/20 21:39:46
Done.
| |
| 61 // been updated. Return false if the override country is the same as the | |
| 62 // stored variable, or if the update failed for any other reason. | |
| 63 static bool OverrideStoredPermanentCountry(const std::string& country); | |
| 64 | |
| 59 // Helper method to return the TranslateAcceptLanguages instance associated | 65 // Helper method to return the TranslateAcceptLanguages instance associated |
| 60 // with |browser_context|. | 66 // with |browser_context|. |
| 61 static translate::TranslateAcceptLanguages* GetTranslateAcceptLanguages( | 67 static translate::TranslateAcceptLanguages* GetTranslateAcceptLanguages( |
| 62 content::BrowserContext* browser_context); | 68 content::BrowserContext* browser_context); |
| 63 | 69 |
| 64 // Helper method to return the TranslateManager instance associated with | 70 // Helper method to return the TranslateManager instance associated with |
| 65 // |web_contents|, or NULL if there is no such associated instance. | 71 // |web_contents|, or NULL if there is no such associated instance. |
| 66 static translate::TranslateManager* GetManagerFromWebContents( | 72 static translate::TranslateManager* GetManagerFromWebContents( |
| 67 content::WebContents* web_contents); | 73 content::WebContents* web_contents); |
| 68 | 74 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 void ShowBubble(translate::TranslateStep step, | 120 void ShowBubble(translate::TranslateStep step, |
| 115 translate::TranslateErrors::Type error_type); | 121 translate::TranslateErrors::Type error_type); |
| 116 | 122 |
| 117 translate::ContentTranslateDriver translate_driver_; | 123 translate::ContentTranslateDriver translate_driver_; |
| 118 scoped_ptr<translate::TranslateManager> translate_manager_; | 124 scoped_ptr<translate::TranslateManager> translate_manager_; |
| 119 | 125 |
| 120 DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient); | 126 DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient); |
| 121 }; | 127 }; |
| 122 | 128 |
| 123 #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ | 129 #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ |
| OLD | NEW |