| 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 GetContentSecurityPolicyStyleSrc() const override; |
| 73 std::string GetContentSecurityPolicyImgSrc() const override; |
| 74 std::string GetContentSecurityPolicyFrameSrc() const override; |
| 72 | 75 |
| 73 // 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, |
| 74 // 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 |
| 75 // resource. | 78 // resource. |
| 76 void AddResource(const char* resource, | 79 void AddResource(const char* resource, |
| 77 const char* mime_type, | 80 const char* mime_type, |
| 78 int resource_id); | 81 int resource_id); |
| 79 | 82 |
| 80 private: | 83 private: |
| 81 // Pointer back to the original profile. | 84 // Pointer back to the original profile. |
| 82 Profile* profile_; | 85 Profile* profile_; |
| 83 | 86 |
| 84 // Maps resource files to mime types an resource ids. | 87 // Maps resource files to mime types an resource ids. |
| 85 std::map<std::string, std::pair<std::string, int> > resource_map_; | 88 std::map<std::string, std::pair<std::string, int> > resource_map_; |
| 86 | 89 |
| 87 DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource); | 90 DISALLOW_COPY_AND_ASSIGN(NewTabHTMLSource); |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 void OnShowBookmarkBarChanged(); | 93 void OnShowBookmarkBarChanged(); |
| 91 | 94 |
| 92 Profile* GetProfile() const; | 95 Profile* GetProfile() const; |
| 93 | 96 |
| 94 PrefChangeRegistrar pref_change_registrar_; | 97 PrefChangeRegistrar pref_change_registrar_; |
| 95 | 98 |
| 96 DISALLOW_COPY_AND_ASSIGN(NewTabUI); | 99 DISALLOW_COPY_AND_ASSIGN(NewTabUI); |
| 97 }; | 100 }; |
| 98 | 101 |
| 99 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ | 102 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ |
| OLD | NEW |