| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SEARCH_LOCAL_NTP_SOURCE_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_ |
| 6 #define CHROME_BROWSER_SEARCH_LOCAL_NTP_SOURCE_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "content/public/browser/url_data_source.h" | 10 #include "content/public/browser/url_data_source.h" |
| 11 | 11 |
| 12 class Profile; | 12 namespace dom_distiller { |
| 13 | 13 |
| 14 // Serves HTML and resources for the local new tab page i.e. | 14 // Serves HTML and resources for viewing distilled articles. |
| 15 // chrome-search://local-ntp/local-ntp.html | 15 class DomDistillerViewerSource : public content::URLDataSource { |
| 16 class LocalNtpSource : public content::URLDataSource { | |
| 17 public: | 16 public: |
| 18 explicit LocalNtpSource(Profile* profile); | 17 DomDistillerViewerSource(const std::string& scheme); |
| 19 | 18 |
| 20 private: | 19 private: |
| 21 virtual ~LocalNtpSource(); | 20 virtual ~DomDistillerViewerSource(); |
| 22 | 21 |
| 23 // Overridden from content::URLDataSource: | 22 // Overridden from content::URLDataSource: |
| 24 virtual std::string GetSource() const OVERRIDE; | 23 virtual std::string GetSource() const OVERRIDE; |
| 25 virtual void StartDataRequest( | 24 virtual void StartDataRequest( |
| 26 const std::string& path, | 25 const std::string& path, |
| 27 int render_process_id, | 26 int render_process_id, |
| 28 int render_frame_id, | 27 int render_frame_id, |
| 29 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; | 28 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; |
| 30 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; | 29 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
| 31 virtual bool ShouldServiceRequest( | 30 virtual bool ShouldServiceRequest( |
| 32 const net::URLRequest* request) const OVERRIDE; | 31 const net::URLRequest* request) const OVERRIDE; |
| 33 virtual std::string GetContentSecurityPolicyFrameSrc() const OVERRIDE; | |
| 34 | 32 |
| 35 Profile* profile_; | 33 // The scheme this URLDataSource is hosted under. |
| 34 std::string scheme_; |
| 36 | 35 |
| 37 DISALLOW_COPY_AND_ASSIGN(LocalNtpSource); | 36 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource); |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 #endif // CHROME_BROWSER_SEARCH_LOCAL_NTP_SOURCE_H_ | 39 } // namespace dom_distiller |
| 40 |
| 41 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_ |
| OLD | NEW |