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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 virtual scoped_ptr<TranslatePrefs> GetTranslatePrefs() OVERRIDE; | 93 virtual scoped_ptr<TranslatePrefs> GetTranslatePrefs() OVERRIDE; |
94 virtual TranslateAcceptLanguages* GetTranslateAcceptLanguages() OVERRIDE; | 94 virtual TranslateAcceptLanguages* GetTranslateAcceptLanguages() OVERRIDE; |
95 virtual void ShowTranslateUI(translate::TranslateStep step, | 95 virtual void ShowTranslateUI(translate::TranslateStep step, |
96 const std::string source_language, | 96 const std::string source_language, |
97 const std::string target_language, | 97 const std::string target_language, |
98 TranslateErrors::Type error_type, | 98 TranslateErrors::Type error_type, |
99 bool triggered_from_menu) OVERRIDE; | 99 bool triggered_from_menu) OVERRIDE; |
100 virtual bool IsTranslatableURL(const GURL& url) OVERRIDE; | 100 virtual bool IsTranslatableURL(const GURL& url) OVERRIDE; |
101 virtual void ShowReportLanguageDetectionErrorUI( | 101 virtual void ShowReportLanguageDetectionErrorUI( |
102 const GURL& report_url) OVERRIDE; | 102 const GURL& report_url) OVERRIDE; |
| 103 virtual int GetInfobarIconID() const OVERRIDE; |
103 | 104 |
104 private: | 105 private: |
105 explicit TranslateTabHelper(content::WebContents* web_contents); | 106 explicit TranslateTabHelper(content::WebContents* web_contents); |
106 friend class content::WebContentsUserData<TranslateTabHelper>; | 107 friend class content::WebContentsUserData<TranslateTabHelper>; |
107 friend class test::ScopedCLDDynamicDataHarness; // For cleaning static state. | 108 friend class test::ScopedCLDDynamicDataHarness; // For cleaning static state. |
108 | 109 |
109 // content::WebContentsObserver implementation. | 110 // content::WebContentsObserver implementation. |
110 virtual void NavigationEntryCommitted( | 111 virtual void NavigationEntryCommitted( |
111 const content::LoadCommittedDetails& load_details) OVERRIDE; | 112 const content::LoadCommittedDetails& load_details) OVERRIDE; |
112 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 113 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 172 |
172 // Necessary for binding the callback to HandleCLDDataRequest on the blocking | 173 // Necessary for binding the callback to HandleCLDDataRequest on the blocking |
173 // pool and for delaying translation initialization until the page has | 174 // pool and for delaying translation initialization until the page has |
174 // finished loading on a reload. | 175 // finished loading on a reload. |
175 base::WeakPtrFactory<TranslateTabHelper> weak_pointer_factory_; | 176 base::WeakPtrFactory<TranslateTabHelper> weak_pointer_factory_; |
176 | 177 |
177 DISALLOW_COPY_AND_ASSIGN(TranslateTabHelper); | 178 DISALLOW_COPY_AND_ASSIGN(TranslateTabHelper); |
178 }; | 179 }; |
179 | 180 |
180 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ | 181 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_TAB_HELPER_H_ |
OLD | NEW |