Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: chrome/browser/ui/webui/translate_internals/translate_internals_handler.h

Issue 1903593002: Allows to manually change the stored permanent country in Variations from the translate-internals d… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UI polishing Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void OnTranslateError(const translate::TranslateErrorDetails& details); 54 void OnTranslateError(const translate::TranslateErrorDetails& details);
55 55
56 // Callback for translate events. 56 // Callback for translate events.
57 virtual void OnTranslateEvent( 57 virtual void OnTranslateEvent(
58 const translate::TranslateEventDetails& details); 58 const translate::TranslateEventDetails& details);
59 59
60 // Handles the Javascript message 'removePrefItem'. This message is sent 60 // Handles the Javascript message 'removePrefItem'. This message is sent
61 // when UI requests to remove an item in the preference. 61 // when UI requests to remove an item in the preference.
62 void OnRemovePrefItem(const base::ListValue* args); 62 void OnRemovePrefItem(const base::ListValue* args);
63 63
64 // Handles the Javascript message 'overrideCountry'. This message is sent
65 // when UI requests to override the stored country.
66 void OnOverrideCountry(const base::ListValue* country);
67
64 // Handles the Javascript message 'requestInfo'. This message is sent 68 // Handles the Javascript message 'requestInfo'. This message is sent
65 // when UI needs to show information concerned with the translation. 69 // when UI needs to show information concerned with the translation.
66 // For now, this returns only prefs to Javascript. 70 // For now, this returns only prefs to Javascript.
67 // |args| is not used. 71 // |args| is not used.
68 void OnRequestInfo(const base::ListValue* args); 72 void OnRequestInfo(const base::ListValue* args);
69 73
70 // Sends a messsage to Javascript. 74 // Sends a messsage to Javascript.
71 void SendMessageToJs(const std::string& message, const base::Value& value); 75 void SendMessageToJs(const std::string& message, const base::Value& value);
72 76
73 // Sends the current preference to Javascript. 77 // Sends the current preference to Javascript.
74 void SendPrefsToJs(); 78 void SendPrefsToJs();
75 79
76 // Sends the languages currently supported by the server to JavaScript. 80 // Sends the languages currently supported by the server to JavaScript.
77 void SendSupportedLanguagesToJs(); 81 void SendSupportedLanguagesToJs();
78 82
83 // Sends the stored permanent country to JavaScript.
Alexei Svitkine (slow) 2016/04/20 20:43:54 Nit: Document |is_update| param. Also, JavaScript
hamelphi 2016/04/20 21:39:46 Done.
84 void SendCountryToJs(bool is_update);
85
79 // Subscription for translate events coming from the translate language list. 86 // Subscription for translate events coming from the translate language list.
80 std::unique_ptr< 87 std::unique_ptr<
81 translate::TranslateLanguageList::EventCallbackList::Subscription> 88 translate::TranslateLanguageList::EventCallbackList::Subscription>
82 event_subscription_; 89 event_subscription_;
83 90
84 // Subscription for translate errors coming from the translate manager. 91 // Subscription for translate errors coming from the translate manager.
85 std::unique_ptr< 92 std::unique_ptr<
86 translate::TranslateManager::TranslateErrorCallbackList::Subscription> 93 translate::TranslateManager::TranslateErrorCallbackList::Subscription>
87 error_subscription_; 94 error_subscription_;
88 95
89 content::NotificationRegistrar notification_registrar_; 96 content::NotificationRegistrar notification_registrar_;
90 97
91 DISALLOW_COPY_AND_ASSIGN(TranslateInternalsHandler); 98 DISALLOW_COPY_AND_ASSIGN(TranslateInternalsHandler);
92 }; 99 };
93 100
94 #endif // CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDL ER_H_ 101 #endif // CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDL ER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698