Chromium Code Reviews| Index: chrome/browser/translate/translate_ui_delegate.h |
| diff --git a/chrome/browser/translate/translate_ui_delegate.h b/chrome/browser/translate/translate_ui_delegate.h |
| index 656b6d2310e0f9fc4a2310191a61a355961c9c36..2db4e1302e203291d7c4f686add0dfd87bf455f2 100644 |
| --- a/chrome/browser/translate/translate_ui_delegate.h |
| +++ b/chrome/browser/translate/translate_ui_delegate.h |
| @@ -27,11 +27,25 @@ class TranslateUIDelegate { |
| NO_INDEX = -1, |
| }; |
| + // A pair whose key is a language code and value is a language displyayable |
|
Peter Kasting
2013/11/08 23:47:47
Nit: a language displyayable -> the language's dis
hajimehoshi
2013/11/11 04:01:02
Done.
|
| + // name. |
| + typedef std::pair<std::string, string16> LanguageNamePair; |
| + |
| TranslateUIDelegate(content::WebContents* web_contents, |
| const std::string& original_language, |
| const std::string& target_language); |
| virtual ~TranslateUIDelegate(); |
| + // Gets the language names. The result is set |language_names| and is sorted |
| + // in alphabetical order taking |locale| into account. |
|
Peter Kasting
2013/11/08 23:47:47
I have no idea what language names this is returni
hajimehoshi
2013/11/11 04:01:02
Done.
|
| + static void GetSortedLanguageNames( |
| + const std::string& locale, |
| + std::vector<LanguageNamePair>* language_names); |
|
Peter Kasting
2013/11/08 23:47:47
Don't return via outparam, return by value. RVO w
hajimehoshi
2013/11/11 04:01:02
Done.
|
| + |
| + // Gets the host of the page of |web_content|, or an empty string if no URL is |
|
Peter Kasting
2013/11/08 23:47:47
Nit: Call this |web_contents|
hajimehoshi
2013/11/11 04:01:02
Done.
|
| + // associated with the current page. |
| + static std::string GetPageHost(content::WebContents* web_content); |
| + |
| content::WebContents* web_contents() { return web_contents_; } |
| // Returns the number of languages supported. |
| @@ -91,14 +105,8 @@ class TranslateUIDelegate { |
| void SetAlwaysTranslate(bool value); |
| private: |
| - // Gets the host of the page being translated, or an empty string if no URL is |
| - // associated with the current page. |
| - std::string GetPageHost(); |
| - |
| content::WebContents* web_contents_; |
| - typedef std::pair<std::string, string16> LanguageNamePair; |
| - |
| // The list supported languages for translation. |
| // The pair first string is the language ISO code (ex: en, fr...), the second |
| // string is the displayable name on the current locale. |
| @@ -108,13 +116,6 @@ class TranslateUIDelegate { |
| // The index for language the page is originally in. |
| size_t original_language_index_; |
| - // The index for language the page is originally in that was originally |
| - // reported (original_language_index_ changes if the user selects a new |
| - // original language, but this one does not). This is necessary to report |
| - // language detection errors with the right original language even if the user |
| - // changed the original language. |
| - size_t initial_original_language_index_; |
| - |
| // The index for language the page should be translated to. |
| size_t target_language_index_; |