| 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 <stdint.h> |
| 9 |
| 8 #include <map> | 10 #include <map> |
| 9 #include <string> | 11 #include <string> |
| 10 | 12 |
| 11 #include "base/callback.h" | 13 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 14 #include "base/values.h" | 16 #include "base/values.h" |
| 15 #include "content/browser/webui/url_data_manager.h" | 17 #include "content/browser/webui/url_data_manager.h" |
| 16 #include "content/browser/webui/url_data_source_impl.h" | 18 #include "content/browser/webui/url_data_source_impl.h" |
| 17 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 18 #include "content/public/browser/url_data_source.h" | 20 #include "content/public/browser/url_data_source.h" |
| 19 #include "content/public/browser/web_ui_data_source.h" | 21 #include "content/public/browser/web_ui_data_source.h" |
| 20 #include "ui/base/template_expressions.h" | 22 #include "ui/base/template_expressions.h" |
| 21 | 23 |
| 22 namespace content { | 24 namespace content { |
| 23 | 25 |
| 24 // A data source that can help with implementing the common operations | 26 // A data source that can help with implementing the common operations |
| 25 // needed by the chrome WEBUI settings/history/downloads pages. | 27 // needed by the chrome WEBUI settings/history/downloads pages. |
| 26 class CONTENT_EXPORT WebUIDataSourceImpl | 28 class CONTENT_EXPORT WebUIDataSourceImpl |
| 27 : public NON_EXPORTED_BASE(URLDataSourceImpl), | 29 : public NON_EXPORTED_BASE(URLDataSourceImpl), |
| 28 public NON_EXPORTED_BASE(WebUIDataSource) { | 30 public NON_EXPORTED_BASE(WebUIDataSource) { |
| 29 public: | 31 public: |
| 30 // WebUIDataSource implementation: | 32 // WebUIDataSource implementation: |
| 31 void AddString(const std::string& name, const base::string16& value) override; | 33 void AddString(const std::string& name, const base::string16& value) override; |
| 32 void AddString(const std::string& name, const std::string& value) override; | 34 void AddString(const std::string& name, const std::string& value) override; |
| 33 void AddLocalizedString(const std::string& name, int ids) override; | 35 void AddLocalizedString(const std::string& name, int ids) override; |
| 34 void AddLocalizedStrings( | 36 void AddLocalizedStrings( |
| 35 const base::DictionaryValue& localized_strings) override; | 37 const base::DictionaryValue& localized_strings) override; |
| 36 void AddBoolean(const std::string& name, bool value) override; | 38 void AddBoolean(const std::string& name, bool value) override; |
| 39 void AddInteger(const std::string& name, int32_t value) override; |
| 37 void SetJsonPath(const std::string& path) override; | 40 void SetJsonPath(const std::string& path) override; |
| 38 void AddResourcePath(const std::string& path, int resource_id) override; | 41 void AddResourcePath(const std::string& path, int resource_id) override; |
| 39 void SetDefaultResource(int resource_id) override; | 42 void SetDefaultResource(int resource_id) override; |
| 40 void SetRequestFilter( | 43 void SetRequestFilter( |
| 41 const WebUIDataSource::HandleRequestCallback& callback) override; | 44 const WebUIDataSource::HandleRequestCallback& callback) override; |
| 42 void DisableReplaceExistingSource() override; | 45 void DisableReplaceExistingSource() override; |
| 43 void DisableContentSecurityPolicy() override; | 46 void DisableContentSecurityPolicy() override; |
| 44 void OverrideContentSecurityPolicyObjectSrc(const std::string& data) override; | 47 void OverrideContentSecurityPolicyObjectSrc(const std::string& data) override; |
| 45 void OverrideContentSecurityPolicyChildSrc(const std::string& data) override; | 48 void OverrideContentSecurityPolicyChildSrc(const std::string& data) override; |
| 46 void DisableDenyXFrameOptions() override; | 49 void DisableDenyXFrameOptions() override; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 bool add_load_time_data_defaults_; | 100 bool add_load_time_data_defaults_; |
| 98 bool replace_existing_source_; | 101 bool replace_existing_source_; |
| 99 bool use_gzip_for_all_paths_; | 102 bool use_gzip_for_all_paths_; |
| 100 | 103 |
| 101 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); | 104 DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); |
| 102 }; | 105 }; |
| 103 | 106 |
| 104 } // namespace content | 107 } // namespace content |
| 105 | 108 |
| 106 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ | 109 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_DATA_SOURCE_IMPL_H_ |
| OLD | NEW |