OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 CHROME_BROWSER_UI_WEBUI_PLURAL_STRING_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_PLURAL_STRING_HANDLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "content/public/browser/web_ui_message_handler.h" |
| 10 |
| 11 // A handler which provides pluralized strings. |
| 12 class PluralStringHandler : public content::WebUIMessageHandler { |
| 13 public: |
| 14 PluralStringHandler(); |
| 15 ~PluralStringHandler() override; |
| 16 |
| 17 void AddLocalizedString(const std::string& name, int id); |
| 18 |
| 19 // WebUIMessageHandler: |
| 20 void RegisterMessages() override; |
| 21 |
| 22 private: |
| 23 void HandleGetPluralString(const base::ListValue* args); |
| 24 |
| 25 std::map<std::string, int> name_to_id_; |
| 26 |
| 27 DISALLOW_COPY_AND_ASSIGN(PluralStringHandler); |
| 28 }; |
| 29 |
| 30 #endif // CHROME_BROWSER_UI_WEBUI_PLURAL_STRING_HANDLER_H_ |
OLD | NEW |