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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_H_
6 #define CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "content/public/browser/url_data_source.h"
12 // Serves HTML for displaying the contextual search first-run promo.
13 class ContextualSearchPromoSourceAndroid : public content::URLDataSource {
15 ContextualSearchPromoSourceAndroid();
16 virtual ~ContextualSearchPromoSourceAndroid();
19 // Overridden from content::URLDataSource:
20 virtual void StartDataRequest(
21 const std::string& path_and_query,
22 int render_process_id,
24 const content::URLDataSource::GotDataCallback& callback) OVERRIDE;
25 virtual std::string GetSource() const OVERRIDE;
26 virtual std::string GetMimeType(
27 const std::string& path_and_query) const OVERRIDE;
28 virtual bool ShouldDenyXFrameOptions() const OVERRIDE;
29 virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE;
31 // Sends unmodified resource bytes.
34 const content::URLDataSource::GotDataCallback& callback);
36 // Sends the config JS resource.
37 void SendConfigResource(
38 const content::URLDataSource::GotDataCallback& callback);
40 // Sends HTML with localized strings.
41 void SendHtmlWithStrings(
42 const content::URLDataSource::GotDataCallback& callback);
45 DISALLOW_COPY_AND_ASSIGN(ContextualSearchPromoSourceAndroid);
48 #endif // CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_PROMO_SOURCE_ANDROID_H_