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 CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ |
6 #define CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ | 6 #define CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Helper method to return the TranslateManager instance associated with | 64 // Helper method to return the TranslateManager instance associated with |
65 // |web_contents|, or NULL if there is no such associated instance. | 65 // |web_contents|, or NULL if there is no such associated instance. |
66 static translate::TranslateManager* GetManagerFromWebContents( | 66 static translate::TranslateManager* GetManagerFromWebContents( |
67 content::WebContents* web_contents); | 67 content::WebContents* web_contents); |
68 | 68 |
69 // Gets |source| and |target| language for translation. | 69 // Gets |source| and |target| language for translation. |
70 static void GetTranslateLanguages(content::WebContents* web_contents, | 70 static void GetTranslateLanguages(content::WebContents* web_contents, |
71 std::string* source, | 71 std::string* source, |
72 std::string* target); | 72 std::string* target); |
73 | 73 |
| 74 static void BindContentTranslateDriver( |
| 75 content::RenderFrameHost* render_frame_host, |
| 76 translate::mojom::ContentTranslateDriverRequest request); |
| 77 |
74 // Gets the associated TranslateManager. | 78 // Gets the associated TranslateManager. |
75 translate::TranslateManager* GetTranslateManager(); | 79 translate::TranslateManager* GetTranslateManager(); |
76 | 80 |
77 // Gets the associated WebContents. Returns NULL if the WebContents is being | 81 // Gets the associated WebContents. Returns NULL if the WebContents is being |
78 // destroyed. | 82 // destroyed. |
79 content::WebContents* GetWebContents(); | 83 content::WebContents* GetWebContents(); |
80 | 84 |
81 // TranslateClient implementation. | 85 // TranslateClient implementation. |
82 translate::TranslateDriver* GetTranslateDriver() override; | 86 translate::TranslateDriver* GetTranslateDriver() override; |
83 PrefService* GetPrefs() override; | 87 PrefService* GetPrefs() override; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 void ShowBubble(translate::TranslateStep step, | 119 void ShowBubble(translate::TranslateStep step, |
116 translate::TranslateErrors::Type error_type); | 120 translate::TranslateErrors::Type error_type); |
117 | 121 |
118 translate::ContentTranslateDriver translate_driver_; | 122 translate::ContentTranslateDriver translate_driver_; |
119 std::unique_ptr<translate::TranslateManager> translate_manager_; | 123 std::unique_ptr<translate::TranslateManager> translate_manager_; |
120 | 124 |
121 DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient); | 125 DISALLOW_COPY_AND_ASSIGN(ChromeTranslateClient); |
122 }; | 126 }; |
123 | 127 |
124 #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ | 128 #endif // CHROME_BROWSER_TRANSLATE_CHROME_TRANSLATE_CLIENT_H_ |
OLD | NEW |