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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 std::string GetContentSecurityPolicyScriptSrc() const override; | 71 std::string GetContentSecurityPolicyScriptSrc() const override; |
72 std::string GetContentSecurityPolicyStyleSrc() const override; | 72 std::string GetContentSecurityPolicyStyleSrc() const override; |
73 std::string GetContentSecurityPolicyImgSrc() const override; | 73 std::string GetContentSecurityPolicyImgSrc() const override; |
74 std::string GetContentSecurityPolicyFrameSrc() const override; | 74 std::string GetContentSecurityPolicyChildSrc() const override; |
75 | 75 |
76 // Adds |resource| to the source. |resource_id| is resource id or 0, | 76 // Adds |resource| to the source. |resource_id| is resource id or 0, |
77 // which means return empty data set. |mime_type| is mime type of the | 77 // which means return empty data set. |mime_type| is mime type of the |
78 // resource. | 78 // resource. |
79 void AddResource(const char* resource, | 79 void AddResource(const char* resource, |
80 const char* mime_type, | 80 const char* mime_type, |
81 int resource_id); | 81 int resource_id); |
82 | 82 |
83 private: | 83 private: |
84 // Pointer back to the original profile. | 84 // Pointer back to the original profile. |
85 Profile* profile_; | 85 Profile* profile_; |
86 | 86 |
87 // Maps resource files to mime types an resource ids. | 87 // Maps resource files to mime types an resource ids. |
88 std::map<std::string, std::pair<std::string, int> > resource_map_; | 88 std::map<std::string, std::pair<std::string, int> > resource_map_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource); | 90 DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource); |
91 }; | 91 }; |
92 | 92 |
93 void OnShowBookmarkBarChanged(); | 93 void OnShowBookmarkBarChanged(); |
94 | 94 |
95 Profile* GetProfile() const; | 95 Profile* GetProfile() const; |
96 | 96 |
97 PrefChangeRegistrar pref_change_registrar_; | 97 PrefChangeRegistrar pref_change_registrar_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 99 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
100 }; | 100 }; |
101 | 101 |
102 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 102 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
OLD | NEW |