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_NTP_NEW_TAB_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // content::URLDataSource implementation. | 62 // content::URLDataSource implementation. |
63 std::string GetSource() const override; | 63 std::string GetSource() const override; |
64 void StartDataRequest( | 64 void StartDataRequest( |
65 const std::string& path, | 65 const std::string& path, |
66 int render_process_id, | 66 int render_process_id, |
67 int render_frame_id, | 67 int render_frame_id, |
68 const content::URLDataSource::GotDataCallback& callback) override; | 68 const content::URLDataSource::GotDataCallback& callback) override; |
69 std::string GetMimeType(const std::string&) const override; | 69 std::string GetMimeType(const std::string&) const override; |
70 bool ShouldReplaceExistingSource() const override; | 70 bool ShouldReplaceExistingSource() const override; |
71 bool ShouldAddContentSecurityPolicy() const override; | 71 std::string GetContentSecurityPolicyScriptSrc() const override; |
| 72 std::string GetContentSecurityPolicyObjectSrc() const override; |
72 | 73 |
73 // Adds |resource| to the source. |resource_id| is resource id or 0, | 74 // Adds |resource| to the source. |resource_id| is resource id or 0, |
74 // which means return empty data set. |mime_type| is mime type of the | 75 // which means return empty data set. |mime_type| is mime type of the |
75 // resource. | 76 // resource. |
76 void AddResource(const char* resource, | 77 void AddResource(const char* resource, |
77 const char* mime_type, | 78 const char* mime_type, |
78 int resource_id); | 79 int resource_id); |
79 | 80 |
80 private: | 81 private: |
81 // Pointer back to the original profile. | 82 // Pointer back to the original profile. |
82 Profile* profile_; | 83 Profile* profile_; |
83 | 84 |
84 // Maps resource files to mime types an resource ids. | 85 // Maps resource files to mime types an resource ids. |
85 std::map<std::string, std::pair<std::string, int> > resource_map_; | 86 std::map<std::string, std::pair<std::string, int> > resource_map_; |
86 | 87 |
87 DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource); | 88 DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource); |
88 }; | 89 }; |
89 | 90 |
90 void OnShowBookmarkBarChanged(); | 91 void OnShowBookmarkBarChanged(); |
91 | 92 |
92 Profile* GetProfile() const; | 93 Profile* GetProfile() const; |
93 | 94 |
94 PrefChangeRegistrar pref_change_registrar_; | 95 PrefChangeRegistrar pref_change_registrar_; |
95 | 96 |
96 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 97 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
97 }; | 98 }; |
98 | 99 |
99 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 100 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
OLD | NEW |