Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROME_WEB_UI_DATA_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_DATA_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_DATA_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 15 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 16 | 16 |
| 17 // A data source that can help with implementing the common operations | 17 // A data source that can help with implementing the common operations |
| 18 // needed by the chrome WEBUI settings/history/downloads pages. | 18 // needed by the chrome WEBUI settings/history/downloads pages. |
| 19 class ChromeWebUIDataSource : public ChromeURLDataManager::DataSource { | 19 class ChromeWebUIDataSource : public ChromeURLDataManager::DataSource { |
| 20 public: | 20 public: |
| 21 explicit ChromeWebUIDataSource(const std::string& source_name); | 21 explicit ChromeWebUIDataSource(const std::string& source_name); |
| 22 ChromeWebUIDataSource(const std::string& source_name, MessageLoop* loop); | 22 ChromeWebUIDataSource(const std::string& source_name, MessageLoop* loop); |
| 23 | 23 |
| 24 // Adds a string and its equivalent to our dictionary. | 24 // Adds a string and its equivalent to our dictionary. |
|
Evan Stade
2012/09/14 15:11:30
this comment doesn't make sense to me, does it mak
SteveT
2012/09/14 15:28:37
Let me know if this correction seems better.
| |
| 25 void AddString(const std::string& name, const string16& value); | 25 void AddString(const std::string& name, const string16& value); |
| 26 | 26 |
| 27 // Adds a string and its equivalent to our dictionary. | |
| 28 void AddString(const std::string& name, const std::string& value); | |
| 29 | |
| 27 // Adds a name and its equivaled localized string to our dictionary. | 30 // Adds a name and its equivaled localized string to our dictionary. |
|
Evan Stade
2012/09/14 15:11:30
this one almost makes sense except for "equivaled"
SteveT
2012/09/14 15:28:37
Ditto
| |
| 28 void AddLocalizedString(const std::string& name, int ids); | 31 void AddLocalizedString(const std::string& name, int ids); |
| 29 | 32 |
| 30 // Add strings from |localized_strings| to our dictionary. | 33 // Add strings from |localized_strings| to our dictionary. |
| 31 void AddLocalizedStrings(const DictionaryValue& localized_strings); | 34 void AddLocalizedStrings(const DictionaryValue& localized_strings); |
| 32 | 35 |
| 33 // Accessor for |localized_strings_|. | 36 // Accessor for |localized_strings_|. |
| 34 DictionaryValue* localized_strings() { | 37 DictionaryValue* localized_strings() { |
| 35 return &localized_strings_; | 38 return &localized_strings_; |
| 36 } | 39 } |
| 37 | 40 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 private: | 73 private: |
| 71 int default_resource_; | 74 int default_resource_; |
| 72 bool json_js_format_v2_; | 75 bool json_js_format_v2_; |
| 73 std::string json_path_; | 76 std::string json_path_; |
| 74 std::map<std::string, int> path_to_idr_map_; | 77 std::map<std::string, int> path_to_idr_map_; |
| 75 DictionaryValue localized_strings_; | 78 DictionaryValue localized_strings_; |
| 76 DISALLOW_COPY_AND_ASSIGN(ChromeWebUIDataSource); | 79 DISALLOW_COPY_AND_ASSIGN(ChromeWebUIDataSource); |
| 77 }; | 80 }; |
| 78 | 81 |
| 79 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_DATA_SOURCE_H_ | 82 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_DATA_SOURCE_H_ |
| OLD | NEW |