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 COMPONENTS_TRANSLATE_IOS_BROWSER_LANGUAGE_DETECTION_CONTROLLER_H_ | 5 #ifndef COMPONENTS_TRANSLATE_IOS_BROWSER_LANGUAGE_DETECTION_CONTROLLER_H_ |
6 #define COMPONENTS_TRANSLATE_IOS_BROWSER_LANGUAGE_DETECTION_CONTROLLER_H_ | 6 #define COMPONENTS_TRANSLATE_IOS_BROWSER_LANGUAGE_DETECTION_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_list.h" | 10 #include "base/callback_list.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const GURL& url, | 69 const GURL& url, |
70 bool interacting); | 70 bool interacting); |
71 | 71 |
72 // Completion handler used to retrieve the text buffered by the | 72 // Completion handler used to retrieve the text buffered by the |
73 // JsLanguageDetectionManager. | 73 // JsLanguageDetectionManager. |
74 void OnTextRetrieved(const std::string& http_content_language, | 74 void OnTextRetrieved(const std::string& http_content_language, |
75 const std::string& html_lang, | 75 const std::string& html_lang, |
76 const base::string16& text); | 76 const base::string16& text); |
77 | 77 |
78 // web::WebStateObserver implementation: | 78 // web::WebStateObserver implementation: |
79 void PageLoaded() override; | 79 void PageLoaded( |
| 80 web::PageLoadCompletionStatus load_completion_status) override; |
80 void URLHashChanged() override; | 81 void URLHashChanged() override; |
81 void HistoryStateChanged() override; | 82 void HistoryStateChanged() override; |
82 void WebStateDestroyed() override; | 83 void WebStateDestroyed() override; |
83 | 84 |
84 CallbackList language_detection_callbacks_; | 85 CallbackList language_detection_callbacks_; |
85 base::scoped_nsobject<JsLanguageDetectionManager> js_manager_; | 86 base::scoped_nsobject<JsLanguageDetectionManager> js_manager_; |
86 BooleanPrefMember translate_enabled_; | 87 BooleanPrefMember translate_enabled_; |
87 base::WeakPtrFactory<LanguageDetectionController> weak_method_factory_; | 88 base::WeakPtrFactory<LanguageDetectionController> weak_method_factory_; |
88 | 89 |
89 DISALLOW_COPY_AND_ASSIGN(LanguageDetectionController); | 90 DISALLOW_COPY_AND_ASSIGN(LanguageDetectionController); |
90 }; | 91 }; |
91 | 92 |
92 } // namespace translate | 93 } // namespace translate |
93 | 94 |
94 #endif // COMPONENTS_TRANSLATE_IOS_BROWSER_LANGUAGE_DETECTION_CONTROLLER_H_ | 95 #endif // COMPONENTS_TRANSLATE_IOS_BROWSER_LANGUAGE_DETECTION_CONTROLLER_H_ |
OLD | NEW |