| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/ntp_resource_cache.h" | 5 #include "chrome/browser/dom_ui/ntp_resource_cache.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/animation.h" | 10 #include "app/animation.h" |
| 11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
| 12 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
| 13 #include "app/theme_provider.h" | 13 #include "app/theme_provider.h" |
| 14 #include "base/command_line.h" | |
| 15 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 16 #include "base/ref_counted_memory.h" | 15 #include "base/ref_counted_memory.h" |
| 17 #include "base/string16.h" | 16 #include "base/string16.h" |
| 18 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
| 19 #include "base/time.h" | 18 #include "base/time.h" |
| 20 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 21 #include "base/values.h" | 20 #include "base/values.h" |
| 22 #include "chrome/browser/chrome_thread.h" | 21 #include "chrome/browser/chrome_thread.h" |
| 23 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 22 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 24 #include "chrome/browser/dom_ui/shown_sections_handler.h" | 23 #include "chrome/browser/dom_ui/shown_sections_handler.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 GetUrlWithLang(GURL(Extension::ChromeStoreLaunchURL()))); | 296 GetUrlWithLang(GURL(Extension::ChromeStoreLaunchURL()))); |
| 298 localized_strings.SetString("appspromohide", | 297 localized_strings.SetString("appspromohide", |
| 299 l10n_util::GetStringUTF16(IDS_APPS_PROMO_HIDE)); | 298 l10n_util::GetStringUTF16(IDS_APPS_PROMO_HIDE)); |
| 300 localized_strings.SetString("appspromoheader", | 299 localized_strings.SetString("appspromoheader", |
| 301 l10n_util::GetStringUTF16(IDS_APPS_PROMO_HEADER)); | 300 l10n_util::GetStringUTF16(IDS_APPS_PROMO_HEADER)); |
| 302 localized_strings.SetString("appspromotext1", | 301 localized_strings.SetString("appspromotext1", |
| 303 l10n_util::GetStringUTF16(IDS_APPS_PROMO_TEXT_1)); | 302 l10n_util::GetStringUTF16(IDS_APPS_PROMO_TEXT_1)); |
| 304 localized_strings.SetString("appspromotext2", | 303 localized_strings.SetString("appspromotext2", |
| 305 l10n_util::GetStringUTF16(IDS_APPS_PROMO_TEXT_2)); | 304 l10n_util::GetStringUTF16(IDS_APPS_PROMO_TEXT_2)); |
| 306 | 305 |
| 307 localized_strings.SetString("appspromovisible", | |
| 308 CommandLine::ForCurrentProcess()->HasSwitch( | |
| 309 switches::kForceAppsPromoVisible) ? "true" : "false"); | |
| 310 | |
| 311 // Don't initiate the sync related message passing with the page if the sync | 306 // Don't initiate the sync related message passing with the page if the sync |
| 312 // code is not present. | 307 // code is not present. |
| 313 if (profile_->GetProfileSyncService()) | 308 if (profile_->GetProfileSyncService()) |
| 314 localized_strings.SetString("syncispresent", "true"); | 309 localized_strings.SetString("syncispresent", "true"); |
| 315 else | 310 else |
| 316 localized_strings.SetString("syncispresent", "false"); | 311 localized_strings.SetString("syncispresent", "false"); |
| 317 | 312 |
| 318 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); | 313 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); |
| 319 | 314 |
| 320 // Control fade and resize animations. | 315 // Control fade and resize animations. |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 std::string css_string; | 499 std::string css_string; |
| 505 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 500 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
| 506 css_string = ReplaceStringPlaceholders(css_string, subst2, NULL); | 501 css_string = ReplaceStringPlaceholders(css_string, subst2, NULL); |
| 507 css_string = ReplaceStringPlaceholders(css_string, subst3, NULL); | 502 css_string = ReplaceStringPlaceholders(css_string, subst3, NULL); |
| 508 | 503 |
| 509 new_tab_css_ = new RefCountedBytes; | 504 new_tab_css_ = new RefCountedBytes; |
| 510 new_tab_css_->data.resize(css_string.size()); | 505 new_tab_css_->data.resize(css_string.size()); |
| 511 std::copy(css_string.begin(), css_string.end(), | 506 std::copy(css_string.begin(), css_string.end(), |
| 512 new_tab_css_->data.begin()); | 507 new_tab_css_->data.begin()); |
| 513 } | 508 } |
| OLD | NEW |