| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_CLIENT_H_ |
| 6 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_CLIENT_H_ |
| 7 |
| 8 #include "components/translate/core/browser/translate_client.h" |
| 9 |
| 10 namespace content { |
| 11 struct LoadCommittedDetails; |
| 12 class NavigationController; |
| 13 } |
| 14 |
| 15 class LanguageStateObserver; |
| 16 |
| 17 // Content implementation of TranslateClient. |
| 18 class ContentTranslateClient : public TranslateClient { |
| 19 public: |
| 20 |
| 21 ContentTranslateClient(content::NavigationController* nav_controller); |
| 22 virtual ~ContentTranslateClient(); |
| 23 |
| 24 // Sets the LanguageStateObserver. Calling this method is optional. |
| 25 void SetLanguageStateObserver(LanguageStateObserver* observer); |
| 26 |
| 27 // Must be called on navigations. |
| 28 void DidNavigate(const content::LoadCommittedDetails& details); |
| 29 |
| 30 private: |
| 31 // TranslateClient methods |
| 32 virtual void OnIsPageTranslatedChanged() OVERRIDE; |
| 33 virtual void OnTranslateEnabledChanged() OVERRIDE; |
| 34 virtual bool IsLinkNavigation() OVERRIDE; |
| 35 |
| 36 // The navigation controller of the tab we are associated with. |
| 37 content::NavigationController* navigation_controller_; |
| 38 |
| 39 LanguageStateObserver* language_state_observer_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(ContentTranslateClient); |
| 42 }; |
| 43 |
| 44 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_CLIENT_H_ |
| OLD | NEW |