| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDLER_
H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDLER_
H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDLER_
H_ | 6 #define CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDLER_
H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/callback_list.h" | 11 #include "base/callback_list.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "components/translate/core/browser/translate_language_list.h" | 13 #include "components/translate/core/browser/translate_language_list.h" |
| 14 #include "components/translate/core/browser/translate_manager.h" | 14 #include "components/translate/core/browser/translate_manager.h" |
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "content/public/browser/web_ui_message_handler.h" | 17 #include "content/public/browser/web_ui_message_handler.h" |
| 18 #include "content/public/common/webplugininfo.h" | 18 #include "content/public/common/webplugininfo.h" |
| 19 | 19 |
| 20 namespace translate { | 20 namespace translate { |
| 21 struct LanguageDetectionDetails; | 21 struct LanguageDetectionDetails; |
| 22 struct TranslateErrorDetails; | 22 struct TranslateErrorDetails; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Sends a messsage to Javascript. | 70 // Sends a messsage to Javascript. |
| 71 void SendMessageToJs(const std::string& message, const base::Value& value); | 71 void SendMessageToJs(const std::string& message, const base::Value& value); |
| 72 | 72 |
| 73 // Sends the current preference to Javascript. | 73 // Sends the current preference to Javascript. |
| 74 void SendPrefsToJs(); | 74 void SendPrefsToJs(); |
| 75 | 75 |
| 76 // Sends the languages currently supported by the server to JavaScript. | 76 // Sends the languages currently supported by the server to JavaScript. |
| 77 void SendSupportedLanguagesToJs(); | 77 void SendSupportedLanguagesToJs(); |
| 78 | 78 |
| 79 // Subscription for translate events coming from the translate language list. | 79 // Subscription for translate events coming from the translate language list. |
| 80 scoped_ptr<translate::TranslateLanguageList::EventCallbackList::Subscription> | 80 std::unique_ptr< |
| 81 translate::TranslateLanguageList::EventCallbackList::Subscription> |
| 81 event_subscription_; | 82 event_subscription_; |
| 82 | 83 |
| 83 // Subscription for translate errors coming from the translate manager. | 84 // Subscription for translate errors coming from the translate manager. |
| 84 scoped_ptr< | 85 std::unique_ptr< |
| 85 translate::TranslateManager::TranslateErrorCallbackList::Subscription> | 86 translate::TranslateManager::TranslateErrorCallbackList::Subscription> |
| 86 error_subscription_; | 87 error_subscription_; |
| 87 | 88 |
| 88 content::NotificationRegistrar notification_registrar_; | 89 content::NotificationRegistrar notification_registrar_; |
| 89 | 90 |
| 90 DISALLOW_COPY_AND_ASSIGN(TranslateInternalsHandler); | 91 DISALLOW_COPY_AND_ASSIGN(TranslateInternalsHandler); |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 #endif // CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDL
ER_H_ | 94 #endif // CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDL
ER_H_ |
| OLD | NEW |