| 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 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" | 5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); | 74 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); |
| 75 | 75 |
| 76 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); | 76 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); |
| 77 | 77 |
| 78 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). | 78 base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance(). |
| 79 GetRawDataResource(IDR_NEW_TAB_4_HTML, | 79 GetRawDataResource(IDR_NEW_TAB_4_HTML, |
| 80 ui::SCALE_FACTOR_NONE)); | 80 ui::SCALE_FACTOR_NONE)); |
| 81 localized_strings.SetString( | 81 localized_strings.SetString( |
| 82 "device", | 82 "device", |
| 83 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUi) ? | 83 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI) ? |
| 84 "tablet" : "phone"); | 84 "tablet" : "phone"); |
| 85 const char* new_tab_link = kLearnMoreIncognitoUrl; | 85 const char* new_tab_link = kLearnMoreIncognitoUrl; |
| 86 string16 learnMoreLink = ASCIIToUTF16( | 86 string16 learnMoreLink = ASCIIToUTF16( |
| 87 google_util::AppendGoogleLocaleParam(GURL(new_tab_link)).spec()); | 87 google_util::AppendGoogleLocaleParam(GURL(new_tab_link)).spec()); |
| 88 localized_strings.SetString("content", | 88 localized_strings.SetString("content", |
| 89 l10n_util::GetStringFUTF16(IDS_NEW_TAB_OTR_MESSAGE, learnMoreLink)); | 89 l10n_util::GetStringFUTF16(IDS_NEW_TAB_OTR_MESSAGE, learnMoreLink)); |
| 90 | 90 |
| 91 // Load the new tab page appropriate for this build. | 91 // Load the new tab page appropriate for this build. |
| 92 std::string full_html; | 92 std::string full_html; |
| 93 | 93 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 106 size_t after_offset = pos + template_data_placeholder.size(); | 106 size_t after_offset = pos + template_data_placeholder.size(); |
| 107 full_html.append(new_tab_html.data() + after_offset, | 107 full_html.append(new_tab_html.data() + after_offset, |
| 108 new_tab_html.size() - after_offset); | 108 new_tab_html.size() - after_offset); |
| 109 } else { | 109 } else { |
| 110 NOTREACHED(); | 110 NOTREACHED(); |
| 111 full_html.assign(new_tab_html.data(), new_tab_html.size()); | 111 full_html.assign(new_tab_html.data(), new_tab_html.size()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 new_tab_html_ = base::RefCountedString::TakeString(&full_html); | 114 new_tab_html_ = base::RefCountedString::TakeString(&full_html); |
| 115 } | 115 } |
| OLD | NEW |