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" |
11 #include "components/translate/core/browser/translate_prefs.h" | 11 #include "components/translate/core/browser/translate_prefs.h" |
12 #include "components/translate/core/browser/translate_step.h" | 12 #include "components/translate/core/browser/translate_step.h" |
13 #include "components/translate/core/common/translate_errors.h" | 13 #include "components/translate/core/common/translate_errors.h" |
14 | 14 |
| 15 class GURL; |
15 class PrefService; | 16 class PrefService; |
16 class TranslateAcceptLanguages; | 17 class TranslateAcceptLanguages; |
17 class TranslateDriver; | 18 class TranslateDriver; |
18 | 19 |
19 // A client interface that needs to be supplied to TranslateManager by the | 20 // A client interface that needs to be supplied to TranslateManager by the |
20 // embedder. | 21 // embedder. |
21 // | 22 // |
22 // Each client instance is associated with a given context within which a | 23 // Each client instance is associated with a given context within which a |
23 // TranslateManager is used (e.g. a single tab). | 24 // TranslateManager is used (e.g. a single tab). |
24 class TranslateClient { | 25 class TranslateClient { |
(...skipping 10 matching lines...) Expand all Loading... |
35 // Returns the associated TranslateAcceptLanguages. | 36 // Returns the associated TranslateAcceptLanguages. |
36 virtual TranslateAcceptLanguages* GetTranslateAcceptLanguages() = 0; | 37 virtual TranslateAcceptLanguages* GetTranslateAcceptLanguages() = 0; |
37 | 38 |
38 // Called when the embedder should present UI to the user corresponding to the | 39 // Called when the embedder should present UI to the user corresponding to the |
39 // user's current |step|. | 40 // user's current |step|. |
40 virtual void ShowTranslateUI(translate::TranslateStep step, | 41 virtual void ShowTranslateUI(translate::TranslateStep step, |
41 const std::string source_language, | 42 const std::string source_language, |
42 const std::string target_language, | 43 const std::string target_language, |
43 TranslateErrors::Type error_type, | 44 TranslateErrors::Type error_type, |
44 bool triggered_from_menu) = 0; | 45 bool triggered_from_menu) = 0; |
| 46 |
| 47 // Returns true if the URL can be translated. |
| 48 virtual bool IsTranslatableURL(const GURL& url) = 0; |
45 }; | 49 }; |
46 | 50 |
47 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_CLIENT_H_ | 51 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_CLIENT_H_ |
OLD | NEW |