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

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

Issue 107303002: Make the TranslateInfoBarDelegate once again use the TranslateUIDelegate. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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_ui_delegate.h
===================================================================
--- chrome/browser/translate/translate_ui_delegate.h (revision 239110)
+++ chrome/browser/translate/translate_ui_delegate.h (working copy)
@@ -22,9 +22,6 @@
// The TranslateUIDelegate is a generic delegate for UI which offers Translate
// feature to the user.
-//
-// Note: TranslateInfobarDelegate should be updated if this implementation is
-// updated.
class TranslateUIDelegate {
public:
enum {
@@ -31,10 +28,6 @@
NO_INDEX = -1,
};
- // A pair whose key is a language code and value is the language's
- // displayable name.
- typedef std::pair<std::string, string16> LanguageNamePair;
-
TranslateUIDelegate(content::WebContents* web_contents,
const std::string& original_language,
const std::string& target_language,
@@ -41,15 +34,6 @@
TranslateErrors::Type error_type);
virtual ~TranslateUIDelegate();
- // Retrieves the displayable names of the supported languages, based on
- // |locale|. The returned names are sorted in alphabetical order.
- static std::vector<LanguageNamePair> GetSortedLanguageNames(
- const std::string& locale);
-
- // Gets the host of the page of |web_contents|, or an empty string if no URL
- // is associated with the current page.
- static std::string GetPageHost(content::WebContents* web_contents);
-
content::WebContents* web_contents() { return web_contents_; }
TranslateErrors::Type error_type() const { return error_type_; }
@@ -115,8 +99,14 @@
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.
@@ -126,6 +116,13 @@
// 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_;
« no previous file with comments | « chrome/browser/translate/translate_manager_browsertest.cc ('k') | chrome/browser/translate/translate_ui_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698