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 CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
6 #define CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 // A data source that can help with implementing the common operations | 23 // A data source that can help with implementing the common operations |
24 // needed by the chrome WEBUI settings/history/downloads pages. | 24 // needed by the chrome WEBUI settings/history/downloads pages. |
25 class CONTENT_EXPORT WebUIDataSourceImpl | 25 class CONTENT_EXPORT WebUIDataSourceImpl |
26 : public NON_EXPORTED_BASE(URLDataSourceImpl), | 26 : public NON_EXPORTED_BASE(URLDataSourceImpl), |
27 public NON_EXPORTED_BASE(WebUIDataSource) { | 27 public NON_EXPORTED_BASE(WebUIDataSource) { |
28 public: | 28 public: |
29 // WebUIDataSource implementation: | 29 // WebUIDataSource implementation: |
30 virtual void AddString(const std::string& name, | 30 virtual void AddString(const std::string& name, |
31 const base::string16& value) OVERRIDE; | 31 const base::string16& value) override; |
32 virtual void AddString(const std::string& name, | 32 virtual void AddString(const std::string& name, |
33 const std::string& value) OVERRIDE; | 33 const std::string& value) override; |
34 virtual void AddLocalizedString(const std::string& name, int ids) OVERRIDE; | 34 virtual void AddLocalizedString(const std::string& name, int ids) override; |
35 virtual void AddLocalizedStrings( | 35 virtual void AddLocalizedStrings( |
36 const base::DictionaryValue& localized_strings) OVERRIDE; | 36 const base::DictionaryValue& localized_strings) override; |
37 virtual void AddBoolean(const std::string& name, bool value) OVERRIDE; | 37 virtual void AddBoolean(const std::string& name, bool value) override; |
38 virtual void SetJsonPath(const std::string& path) OVERRIDE; | 38 virtual void SetJsonPath(const std::string& path) override; |
39 virtual void AddResourcePath(const std::string &path, | 39 virtual void AddResourcePath(const std::string &path, |
40 int resource_id) OVERRIDE; | 40 int resource_id) override; |
41 virtual void SetDefaultResource(int resource_id) OVERRIDE; | 41 virtual void SetDefaultResource(int resource_id) override; |
42 virtual void SetRequestFilter( | 42 virtual void SetRequestFilter( |
43 const WebUIDataSource::HandleRequestCallback& callback) OVERRIDE; | 43 const WebUIDataSource::HandleRequestCallback& callback) override; |
44 virtual void DisableReplaceExistingSource() OVERRIDE; | 44 virtual void DisableReplaceExistingSource() override; |
45 virtual void DisableContentSecurityPolicy() OVERRIDE; | 45 virtual void DisableContentSecurityPolicy() override; |
46 virtual void OverrideContentSecurityPolicyObjectSrc( | 46 virtual void OverrideContentSecurityPolicyObjectSrc( |
47 const std::string& data) OVERRIDE; | 47 const std::string& data) override; |
48 virtual void OverrideContentSecurityPolicyFrameSrc( | 48 virtual void OverrideContentSecurityPolicyFrameSrc( |
49 const std::string& data) OVERRIDE; | 49 const std::string& data) override; |
50 virtual void DisableDenyXFrameOptions() OVERRIDE; | 50 virtual void DisableDenyXFrameOptions() override; |
51 | 51 |
52 protected: | 52 protected: |
53 virtual ~WebUIDataSourceImpl(); | 53 virtual ~WebUIDataSourceImpl(); |
54 | 54 |
55 // Completes a request by sending our dictionary of localized strings. | 55 // Completes a request by sending our dictionary of localized strings. |
56 void SendLocalizedStringsAsJSON( | 56 void SendLocalizedStringsAsJSON( |
57 const URLDataSource::GotDataCallback& callback); | 57 const URLDataSource::GotDataCallback& callback); |
58 | 58 |
59 // Completes a request by sending the file specified by |idr|. | 59 // Completes a request by sending the file specified by |idr|. |
60 void SendFromResourceBundle( | 60 void SendFromResourceBundle( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 bool deny_xframe_options_; | 99 bool deny_xframe_options_; |
100 bool disable_set_font_strings_; | 100 bool disable_set_font_strings_; |
101 bool replace_existing_source_; | 101 bool replace_existing_source_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); | 103 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); |
104 }; | 104 }; |
105 | 105 |
106 } // content | 106 } // content |
107 | 107 |
108 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 108 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
OLD | NEW |