OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // detected. This call is initiated by the user selecting the "report" menu | 65 // detected. This call is initiated by the user selecting the "report" menu |
66 // under options in the translate infobar. | 66 // under options in the translate infobar. |
67 void ReportLanguageDetectionError(TabContents* tab_contents); | 67 void ReportLanguageDetectionError(TabContents* tab_contents); |
68 | 68 |
69 // Clears the translate script, so it will be fetched next time we translate. | 69 // Clears the translate script, so it will be fetched next time we translate. |
70 void ClearTranslateScript() { translate_script_.clear(); } | 70 void ClearTranslateScript() { translate_script_.clear(); } |
71 | 71 |
72 // content::NotificationObserver implementation: | 72 // content::NotificationObserver implementation: |
73 virtual void Observe(int type, | 73 virtual void Observe(int type, |
74 const content::NotificationSource& source, | 74 const content::NotificationSource& source, |
75 const content::NotificationDetails& details); | 75 const content::NotificationDetails& details) OVERRIDE; |
76 | 76 |
77 // content::URLFetcherDelegate implementation: | 77 // content::URLFetcherDelegate implementation: |
78 virtual void OnURLFetchComplete(const content::URLFetcher* source); | 78 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; |
79 | 79 |
80 // Used by unit-tests to override the default delay after which the translate | 80 // Used by unit-tests to override the default delay after which the translate |
81 // script is fetched again from the translation server. | 81 // script is fetched again from the translation server. |
82 void set_translate_script_expiration_delay(int delay_ms) { | 82 void set_translate_script_expiration_delay(int delay_ms) { |
83 translate_script_expiration_delay_ = delay_ms; | 83 translate_script_expiration_delay_ = delay_ms; |
84 } | 84 } |
85 | 85 |
86 // Convenience method to know if a tab is showing a translate infobar. | 86 // Convenience method to know if a tab is showing a translate infobar. |
87 static bool IsShowingTranslateInfobar(TabContents* tab); | 87 static bool IsShowingTranslateInfobar(TabContents* tab); |
88 | 88 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // server. | 208 // server. |
209 std::vector<PendingRequest> pending_requests_; | 209 std::vector<PendingRequest> pending_requests_; |
210 | 210 |
211 // The languages supported by the translation server. | 211 // The languages supported by the translation server. |
212 static base::LazyInstance<std::set<std::string> > supported_languages_; | 212 static base::LazyInstance<std::set<std::string> > supported_languages_; |
213 | 213 |
214 DISALLOW_COPY_AND_ASSIGN(TranslateManager); | 214 DISALLOW_COPY_AND_ASSIGN(TranslateManager); |
215 }; | 215 }; |
216 | 216 |
217 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ | 217 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ |
OLD | NEW |