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

Side by Side Diff: chrome/browser/translate/translate_manager.h

Issue 15470004: Translate: display alpha language name with (alpha) suffix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update resource description Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_TRANSLATE_MANAGER_H_ 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // translate to and from. 107 // translate to and from.
108 static void GetSupportedLanguages(std::vector<std::string>* languages); 108 static void GetSupportedLanguages(std::vector<std::string>* languages);
109 109
110 // Returns the language code that can be used with the Translate method for a 110 // Returns the language code that can be used with the Translate method for a
111 // specified |chrome_locale|. 111 // specified |chrome_locale|.
112 static std::string GetLanguageCode(const std::string& chrome_locale); 112 static std::string GetLanguageCode(const std::string& chrome_locale);
113 113
114 // Returns true if |language| is supported by the translation server. 114 // Returns true if |language| is supported by the translation server.
115 static bool IsSupportedLanguage(const std::string& language); 115 static bool IsSupportedLanguage(const std::string& language);
116 116
117 // Returns true if |language| is supported by the translation server as a
118 // alpha language.
119 static bool IsAlphaLanguage(const std::string& language);
120
117 // The observer class for TranslateManager. 121 // The observer class for TranslateManager.
118 class Observer { 122 class Observer {
119 public: 123 public:
120 virtual void OnLanguageDetection( 124 virtual void OnLanguageDetection(
121 const LanguageDetectionDetails& details) = 0; 125 const LanguageDetectionDetails& details) = 0;
122 }; 126 };
123 127
124 // Adds/removes observer. 128 // Adds/removes observer.
125 void AddObserver(Observer* obs); 129 void AddObserver(Observer* obs);
126 void RemoveObserver(Observer* obs); 130 void RemoveObserver(Observer* obs);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // List of registered observers. 229 // List of registered observers.
226 ObserverList<Observer> observer_list_; 230 ObserverList<Observer> observer_list_;
227 231
228 // An instance of TranslateLanguageList which manages supported language list. 232 // An instance of TranslateLanguageList which manages supported language list.
229 scoped_ptr<TranslateLanguageList> language_list_; 233 scoped_ptr<TranslateLanguageList> language_list_;
230 234
231 DISALLOW_COPY_AND_ASSIGN(TranslateManager); 235 DISALLOW_COPY_AND_ASSIGN(TranslateManager);
232 }; 236 };
233 237
234 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ 238 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698