OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class DictionaryValue; | 13 class DictionaryValue; |
14 class RefCountedMemory; | 14 class RefCountedMemory; |
15 } | 15 } |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class BrowserContext; | 18 class BrowserContext; |
19 | 19 |
20 // A data source that can help with implementing the common operations needed by | 20 // A data source that can help with implementing the common operations needed by |
21 // WebUI pages. | 21 // WebUI pages. |
22 class WebUIDataSource { | 22 class WebUIDataSource { |
23 public: | 23 public: |
24 virtual ~WebUIDataSource() {} | 24 virtual ~WebUIDataSource() {} |
25 | 25 |
26 CONTENT_EXPORT static WebUIDataSource* Create(const std::string& source_name); | 26 CONTENT_EXPORT static WebUIDataSource* Create(const std::string& source_name); |
27 | 27 |
28 #if defined(USE_MOJO) | |
29 // Adds the necessary resources for mojo bindings returning the | |
30 // WebUIDataSource that handles the resources. Callers do not own the return | |
31 // value. | |
32 CONTENT_EXPORT static WebUIDataSource* AddMojoDataSource( | |
33 BrowserContext* browser_context); | |
34 #endif | |
35 | |
36 // Adds a WebUI data source to |browser_context|. | 28 // Adds a WebUI data source to |browser_context|. |
37 CONTENT_EXPORT static void Add(BrowserContext* browser_context, | 29 CONTENT_EXPORT static void Add(BrowserContext* browser_context, |
38 WebUIDataSource* source); | 30 WebUIDataSource* source); |
39 | 31 |
40 // Adds a string keyed to its name to our dictionary. | 32 // Adds a string keyed to its name to our dictionary. |
41 virtual void AddString(const std::string& name, | 33 virtual void AddString(const std::string& name, |
42 const base::string16& value) = 0; | 34 const base::string16& value) = 0; |
43 | 35 |
44 // Adds a string keyed to its name to our dictionary. | 36 // Adds a string keyed to its name to our dictionary. |
45 virtual void AddString(const std::string& name, const std::string& value) = 0; | 37 virtual void AddString(const std::string& name, const std::string& value) = 0; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 virtual void OverrideContentSecurityPolicyObjectSrc( | 86 virtual void OverrideContentSecurityPolicyObjectSrc( |
95 const std::string& data) = 0; | 87 const std::string& data) = 0; |
96 virtual void OverrideContentSecurityPolicyFrameSrc( | 88 virtual void OverrideContentSecurityPolicyFrameSrc( |
97 const std::string& data) = 0; | 89 const std::string& data) = 0; |
98 virtual void DisableDenyXFrameOptions() = 0; | 90 virtual void DisableDenyXFrameOptions() = 0; |
99 }; | 91 }; |
100 | 92 |
101 } // namespace content | 93 } // namespace content |
102 | 94 |
103 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ | 95 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_DATA_SOURCE_H_ |
OLD | NEW |