| OLD | NEW |
| 1 // Copyright 2014 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_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_H_ |
| 6 #define CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_H_ | 6 #define CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_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 // Serves HTML for displaying the contextual search first-run promo. | 12 // Serves HTML for displaying the contextual search first-run promo. |
| 13 class ContextualSearchPromoSourceAndroid : public content::URLDataSource { | 13 class ContextualSearchPromoSourceAndroid : public content::URLDataSource { |
| 14 public: | 14 public: |
| 15 ContextualSearchPromoSourceAndroid(); | 15 ContextualSearchPromoSourceAndroid(); |
| 16 virtual ~ContextualSearchPromoSourceAndroid(); | 16 ~ContextualSearchPromoSourceAndroid() override; |
| 17 | 17 |
| 18 protected: | 18 protected: |
| 19 // Overridden from content::URLDataSource: | 19 // Overridden from content::URLDataSource: |
| 20 virtual void StartDataRequest( | 20 void StartDataRequest( |
| 21 const std::string& path_and_query, | 21 const std::string& path_and_query, |
| 22 int render_process_id, | 22 int render_process_id, |
| 23 int render_frame_id, | 23 int render_frame_id, |
| 24 const content::URLDataSource::GotDataCallback& callback) override; | 24 const content::URLDataSource::GotDataCallback& callback) override; |
| 25 virtual std::string GetSource() const override; | 25 std::string GetSource() const override; |
| 26 virtual std::string GetMimeType( | 26 std::string GetMimeType(const std::string& path_and_query) const override; |
| 27 const std::string& path_and_query) const override; | 27 bool ShouldDenyXFrameOptions() const override; |
| 28 virtual bool ShouldDenyXFrameOptions() const override; | 28 bool ShouldAddContentSecurityPolicy() const override; |
| 29 virtual bool ShouldAddContentSecurityPolicy() const override; | |
| 30 | 29 |
| 31 // Sends unmodified resource bytes. | 30 // Sends unmodified resource bytes. |
| 32 void SendResource( | 31 void SendResource( |
| 33 int resource_id, | 32 int resource_id, |
| 34 const content::URLDataSource::GotDataCallback& callback); | 33 const content::URLDataSource::GotDataCallback& callback); |
| 35 | 34 |
| 36 // Sends the config JS resource. | 35 // Sends the config JS resource. |
| 37 void SendConfigResource( | 36 void SendConfigResource( |
| 38 const content::URLDataSource::GotDataCallback& callback); | 37 const content::URLDataSource::GotDataCallback& callback); |
| 39 | 38 |
| 40 // Sends HTML with localized strings. | 39 // Sends HTML with localized strings. |
| 41 void SendHtmlWithStrings( | 40 void SendHtmlWithStrings( |
| 42 const content::URLDataSource::GotDataCallback& callback); | 41 const content::URLDataSource::GotDataCallback& callback); |
| 43 | 42 |
| 44 private: | 43 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(ContextualSearchPromoSourceAndroid); | 44 DISALLOW_COPY_AND_ASSIGN(ContextualSearchPromoSourceAndroid); |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 #endif // CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_H_ | 47 #endif // CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_H_ |
| OLD | NEW |