OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_CLIENT_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_CLIENT_H_ |
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_CLIENT_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // Returns the associated PrefService. | 30 // Returns the associated PrefService. |
31 virtual PrefService* GetPrefs() = 0; | 31 virtual PrefService* GetPrefs() = 0; |
32 | 32 |
33 // Returns the associated TranslatePrefs. | 33 // Returns the associated TranslatePrefs. |
34 virtual scoped_ptr<TranslatePrefs> GetTranslatePrefs() = 0; | 34 virtual scoped_ptr<TranslatePrefs> GetTranslatePrefs() = 0; |
35 | 35 |
36 // Returns the associated TranslateAcceptLanguages. | 36 // Returns the associated TranslateAcceptLanguages. |
37 virtual TranslateAcceptLanguages* GetTranslateAcceptLanguages() = 0; | 37 virtual TranslateAcceptLanguages* GetTranslateAcceptLanguages() = 0; |
38 | 38 |
| 39 // Returns the resource ID of the icon to be shown for the Translate infobars. |
| 40 virtual int GetInfobarIconID() const = 0; |
| 41 |
39 // Called when the embedder should present UI to the user corresponding to the | 42 // Called when the embedder should present UI to the user corresponding to the |
40 // user's current |step|. | 43 // user's current |step|. |
41 virtual void ShowTranslateUI(translate::TranslateStep step, | 44 virtual void ShowTranslateUI(translate::TranslateStep step, |
42 const std::string source_language, | 45 const std::string source_language, |
43 const std::string target_language, | 46 const std::string target_language, |
44 TranslateErrors::Type error_type, | 47 TranslateErrors::Type error_type, |
45 bool triggered_from_menu) = 0; | 48 bool triggered_from_menu) = 0; |
46 | 49 |
47 // Returns true if the URL can be translated. | 50 // Returns true if the URL can be translated. |
48 virtual bool IsTranslatableURL(const GURL& url) = 0; | 51 virtual bool IsTranslatableURL(const GURL& url) = 0; |
49 | 52 |
50 // Presents |report_url|, a URL containing information relating to reporting | 53 // Presents |report_url|, a URL containing information relating to reporting |
51 // a language detection error, to the user to allow them to report language | 54 // a language detection error, to the user to allow them to report language |
52 // detection errors as desired. | 55 // detection errors as desired. |
53 virtual void ShowReportLanguageDetectionErrorUI(const GURL& report_url) = 0; | 56 virtual void ShowReportLanguageDetectionErrorUI(const GURL& report_url) = 0; |
54 }; | 57 }; |
55 | 58 |
56 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_CLIENT_H_ | 59 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_CLIENT_H_ |
OLD | NEW |