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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // TranslateClient implementation. | 86 // TranslateClient implementation. |
87 virtual TranslateDriver* GetTranslateDriver() OVERRIDE; | 87 virtual TranslateDriver* GetTranslateDriver() OVERRIDE; |
88 virtual PrefService* GetPrefs() OVERRIDE; | 88 virtual PrefService* GetPrefs() OVERRIDE; |
89 virtual scoped_ptr<TranslatePrefs> GetTranslatePrefs() OVERRIDE; | 89 virtual scoped_ptr<TranslatePrefs> GetTranslatePrefs() OVERRIDE; |
90 virtual TranslateAcceptLanguages* GetTranslateAcceptLanguages() OVERRIDE; | 90 virtual TranslateAcceptLanguages* GetTranslateAcceptLanguages() OVERRIDE; |
91 virtual void ShowTranslateUI(translate::TranslateStep step, | 91 virtual void ShowTranslateUI(translate::TranslateStep step, |
92 const std::string source_language, | 92 const std::string source_language, |
93 const std::string target_language, | 93 const std::string target_language, |
94 TranslateErrors::Type error_type, | 94 TranslateErrors::Type error_type, |
95 bool triggered_from_menu) OVERRIDE; | 95 bool triggered_from_menu) OVERRIDE; |
| 96 virtual bool IsTranslatableURL(const GURL& url) OVERRIDE; |
96 | 97 |
97 private: | 98 private: |
98 explicit TranslateTabHelper(content::WebContents* web_contents); | 99 explicit TranslateTabHelper(content::WebContents* web_contents); |
99 friend class content::WebContentsUserData<TranslateTabHelper>; | 100 friend class content::WebContentsUserData<TranslateTabHelper>; |
100 | 101 |
101 // content::WebContentsObserver implementation. | 102 // content::WebContentsObserver implementation. |
102 virtual void NavigationEntryCommitted( | 103 virtual void NavigationEntryCommitted( |
103 const content::LoadCommittedDetails& load_details) OVERRIDE; | 104 const content::LoadCommittedDetails& load_details) OVERRIDE; |
104 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 105 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
105 virtual void DidNavigateAnyFrame( | 106 virtual void DidNavigateAnyFrame( |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 165 |
165 // Necessary for binding the callback to HandleCLDDataRequest on the blocking | 166 // Necessary for binding the callback to HandleCLDDataRequest on the blocking |
166 // pool and for delaying translation initialization until the page has | 167 // pool and for delaying translation initialization until the page has |
167 // finished loading on a reload. | 168 // finished loading on a reload. |
168 base::WeakPtrFactory<TranslateTabHelper> weak_pointer_factory_; | 169 base::WeakPtrFactory<TranslateTabHelper> weak_pointer_factory_; |
169 | 170 |
170 DISALLOW_COPY_AND_ASSIGN(TranslateTabHelper); | 171 DISALLOW_COPY_AND_ASSIGN(TranslateTabHelper); |
171 }; | 172 }; |
172 | 173 |
173 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ | 174 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ |
OLD | NEW |