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

Side by Side Diff: chrome/browser/ui/webui/chrome_web_ui_data_source.h

Issue 10916182: Refactor the about:version code out of about_ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: rebase + lei nit Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
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 keyed to its name to our dictionary.
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 name and its equivaled localized string to our dictionary. 27 // Adds a string keyed to its name to our dictionary.
28 void AddString(const std::string& name, const std::string& value);
29
30 // Adds a localized string with resource |ids| keyed to its name to our
31 // dictionary.
28 void AddLocalizedString(const std::string& name, int ids); 32 void AddLocalizedString(const std::string& name, int ids);
29 33
30 // Add strings from |localized_strings| to our dictionary. 34 // Add strings from |localized_strings| to our dictionary.
31 void AddLocalizedStrings(const DictionaryValue& localized_strings); 35 void AddLocalizedStrings(const DictionaryValue& localized_strings);
32 36
33 // Accessor for |localized_strings_|. 37 // Accessor for |localized_strings_|.
34 DictionaryValue* localized_strings() { 38 DictionaryValue* localized_strings() {
35 return &localized_strings_; 39 return &localized_strings_;
36 } 40 }
37 41
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 private: 74 private:
71 int default_resource_; 75 int default_resource_;
72 bool json_js_format_v2_; 76 bool json_js_format_v2_;
73 std::string json_path_; 77 std::string json_path_;
74 std::map<std::string, int> path_to_idr_map_; 78 std::map<std::string, int> path_to_idr_map_;
75 DictionaryValue localized_strings_; 79 DictionaryValue localized_strings_;
76 DISALLOW_COPY_AND_ASSIGN(ChromeWebUIDataSource); 80 DISALLOW_COPY_AND_ASSIGN(ChromeWebUIDataSource);
77 }; 81 };
78 82
79 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_DATA_SOURCE_H_ 83 #endif // CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc ('k') | chrome/browser/ui/webui/chrome_web_ui_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698