| 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 #include "chrome/browser/search/contextual_search_promo_source_android.h" | 5 #include "chrome/browser/search/contextual_search_promo_source_android.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted_memory.h" | 7 #include "base/memory/ref_counted_memory.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/grit/chromium_strings.h" |
| 12 #include "grit/browser_resources.h" | 13 #include "grit/browser_resources.h" |
| 13 #include "grit/chromium_strings.h" | |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/base/webui/jstemplate_builder.h" | 16 #include "ui/base/webui/jstemplate_builder.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 const char kPromoHTMLPath[] = "/promo.html"; | 21 const char kPromoHTMLPath[] = "/promo.html"; |
| 22 const char kPromoCSSPath[] = "/promo.css"; | 22 const char kPromoCSSPath[] = "/promo.css"; |
| 23 const char kPromoJSPath[] = "/promo.js"; | 23 const char kPromoJSPath[] = "/promo.js"; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 "optIn", l10n_util::GetStringUTF16(IDS_CONTEXTUAL_SEARCH_PROMO_OPTIN)); | 94 "optIn", l10n_util::GetStringUTF16(IDS_CONTEXTUAL_SEARCH_PROMO_OPTIN)); |
| 95 strings_data.SetString( | 95 strings_data.SetString( |
| 96 "optOut", l10n_util::GetStringUTF16(IDS_CONTEXTUAL_SEARCH_PROMO_OPTOUT)); | 96 "optOut", l10n_util::GetStringUTF16(IDS_CONTEXTUAL_SEARCH_PROMO_OPTOUT)); |
| 97 base::StringPiece html( | 97 base::StringPiece html( |
| 98 ResourceBundle::GetSharedInstance().GetRawDataResource( | 98 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 99 IDR_CONTEXTUAL_SEARCH_PROMO_HTML)); | 99 IDR_CONTEXTUAL_SEARCH_PROMO_HTML)); |
| 100 webui::UseVersion2 version; | 100 webui::UseVersion2 version; |
| 101 std::string response(webui::GetI18nTemplateHtml(html, &strings_data)); | 101 std::string response(webui::GetI18nTemplateHtml(html, &strings_data)); |
| 102 callback.Run(base::RefCountedString::TakeString(&response)); | 102 callback.Run(base::RefCountedString::TakeString(&response)); |
| 103 } | 103 } |
| OLD | NEW |