| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // Helper method to return the TranslateAcceptLanguages instance associated | 58 // Helper method to return the TranslateAcceptLanguages instance associated |
| 59 // with |browser_context|. | 59 // with |browser_context|. |
| 60 static TranslateAcceptLanguages* GetTranslateAcceptLanguages( | 60 static TranslateAcceptLanguages* GetTranslateAcceptLanguages( |
| 61 content::BrowserContext* browser_context); | 61 content::BrowserContext* browser_context); |
| 62 | 62 |
| 63 // Helper method to return the TranslateManager instance associated with | 63 // Helper method to return the TranslateManager instance associated with |
| 64 // |web_contents|, or NULL if there is no such associated instance. | 64 // |web_contents|, or NULL if there is no such associated instance. |
| 65 static TranslateManager* GetManagerFromWebContents( | 65 static TranslateManager* GetManagerFromWebContents( |
| 66 content::WebContents* web_contents); | 66 content::WebContents* web_contents); |
| 67 | 67 |
| 68 // Gets |source| and |target| language for translation. |
| 69 static void GetTranslateLanguages(content::WebContents* web_contents, |
| 70 std::string* source, |
| 71 std::string* target); |
| 72 |
| 68 // Gets the associated TranslateManager. | 73 // Gets the associated TranslateManager. |
| 69 TranslateManager* GetTranslateManager(); | 74 TranslateManager* GetTranslateManager(); |
| 70 | 75 |
| 71 // Gets the associated WebContents. Returns NULL if the WebContents is being | 76 // Gets the associated WebContents. Returns NULL if the WebContents is being |
| 72 // destroyed. | 77 // destroyed. |
| 73 content::WebContents* GetWebContents(); | 78 content::WebContents* GetWebContents(); |
| 74 | 79 |
| 75 // Denotes which state the user is in with respect to translate. | 80 // Denotes which state the user is in with respect to translate. |
| 76 enum TranslateStep { | 81 enum TranslateStep { |
| 77 BEFORE_TRANSLATE, | 82 BEFORE_TRANSLATE, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Shows the translate bubble. | 160 // Shows the translate bubble. |
| 156 void ShowBubble(TranslateStep step, TranslateErrors::Type error_type); | 161 void ShowBubble(TranslateStep step, TranslateErrors::Type error_type); |
| 157 | 162 |
| 158 ContentTranslateDriver translate_driver_; | 163 ContentTranslateDriver translate_driver_; |
| 159 scoped_ptr<TranslateManager> translate_manager_; | 164 scoped_ptr<TranslateManager> translate_manager_; |
| 160 | 165 |
| 161 DISALLOW_COPY_AND_ASSIGN(TranslateTabHelper); | 166 DISALLOW_COPY_AND_ASSIGN(TranslateTabHelper); |
| 162 }; | 167 }; |
| 163 | 168 |
| 164 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ | 169 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ |
| OLD | NEW |