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

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

Issue 225263017: Move TranslateManager::IsTranslatableURL to be a client-level concept. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 8 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 24 matching lines...) Expand all
35 35
36 class TranslateManager { 36 class TranslateManager {
37 public: 37 public:
38 // TranslateTabHelper is expected to outlive the TranslateManager. 38 // TranslateTabHelper is expected to outlive the TranslateManager.
39 // |accept_language_pref_name| is the path for the preference for the 39 // |accept_language_pref_name| is the path for the preference for the
40 // accept-languages. 40 // accept-languages.
41 TranslateManager(TranslateTabHelper* helper, 41 TranslateManager(TranslateTabHelper* helper,
42 const std::string& accept_language_pref_name); 42 const std::string& accept_language_pref_name);
43 virtual ~TranslateManager(); 43 virtual ~TranslateManager();
44 44
45 // Returns true if the URL can be translated.
46 static bool IsTranslatableURL(const GURL& url);
47
48 // Returns the language to translate to. The language returned is the 45 // Returns the language to translate to. The language returned is the
49 // first language found in the following list that is supported by the 46 // first language found in the following list that is supported by the
50 // translation service: 47 // translation service:
51 // the UI language 48 // the UI language
52 // the accept-language list 49 // the accept-language list
53 // If no language is found then an empty string is returned. 50 // If no language is found then an empty string is returned.
54 static std::string GetTargetLanguage( 51 static std::string GetTargetLanguage(
55 const std::vector<std::string>& accept_languages_list); 52 const std::vector<std::string>& accept_languages_list);
56 53
57 // Returns the language to automatically translate to. |original_language| is 54 // Returns the language to automatically translate to. |original_language| is
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 TranslateTabHelper* translate_tab_helper_; // Weak. 111 TranslateTabHelper* translate_tab_helper_; // Weak.
115 TranslateClient* translate_client_; // Weak. 112 TranslateClient* translate_client_; // Weak.
116 TranslateDriver* translate_driver_; // Weak. 113 TranslateDriver* translate_driver_; // Weak.
117 114
118 base::WeakPtrFactory<TranslateManager> weak_method_factory_; 115 base::WeakPtrFactory<TranslateManager> weak_method_factory_;
119 116
120 DISALLOW_COPY_AND_ASSIGN(TranslateManager); 117 DISALLOW_COPY_AND_ASSIGN(TranslateManager);
121 }; 118 };
122 119
123 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ 120 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_context_menu/render_view_context_menu.cc ('k') | chrome/browser/translate/translate_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698