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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/memory/ref_counted_memory.h" | 11 #include "base/memory/ref_counted_memory.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
15 #include "base/time.h" | |
16 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
17 #include "base/values.h" | 16 #include "base/values.h" |
18 #include "chrome/browser/defaults.h" | 17 #include "chrome/browser/defaults.h" |
19 #include "chrome/browser/google/google_util.h" | 18 #include "chrome/browser/google/google_util.h" |
20 #include "chrome/browser/prefs/pref_service.h" | 19 #include "chrome/browser/prefs/pref_service.h" |
21 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/sync/profile_sync_service.h" | 21 #include "chrome/browser/sync/profile_sync_service.h" |
23 #include "chrome/browser/sync/profile_sync_service_factory.h" | 22 #include "chrome/browser/sync/profile_sync_service_factory.h" |
24 #include "chrome/browser/themes/theme_service.h" | 23 #include "chrome/browser/themes/theme_service.h" |
25 #include "chrome/browser/themes/theme_service_factory.h" | 24 #include "chrome/browser/themes/theme_service_factory.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); | 356 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); |
358 localized_strings.SetBoolean("isWebStoreExperimentEnabled", | 357 localized_strings.SetBoolean("isWebStoreExperimentEnabled", |
359 NewTabUI::ShouldShowWebStoreFooterLink()); | 358 NewTabUI::ShouldShowWebStoreFooterLink()); |
360 localized_strings.SetBoolean("appInstallHintEnabled", | 359 localized_strings.SetBoolean("appInstallHintEnabled", |
361 NewTabUI::ShouldShowAppInstallHint()); | 360 NewTabUI::ShouldShowAppInstallHint()); |
362 localized_strings.SetString("appInstallHintText", | 361 localized_strings.SetString("appInstallHintText", |
363 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL)); | 362 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL)); |
364 localized_strings.SetBoolean("isSuggestionsPageEnabled", | 363 localized_strings.SetBoolean("isSuggestionsPageEnabled", |
365 NewTabUI::IsSuggestionsPageEnabled()); | 364 NewTabUI::IsSuggestionsPageEnabled()); |
366 localized_strings.SetBoolean("showApps", NewTabUI::ShouldShowApps()); | 365 localized_strings.SetBoolean("showApps", NewTabUI::ShouldShowApps()); |
366 localized_strings.SetString("hide", | |
Evan Stade
2012/03/30 21:00:30
would prefer more specific variable name
Patrick Dubroy
2012/03/30 21:21:20
Done.
| |
367 l10n_util::GetStringUTF16(IDS_POLICY_HIDE)); | |
367 | 368 |
368 #if defined(OS_CHROMEOS) | 369 #if defined(OS_CHROMEOS) |
369 localized_strings.SetString("expandMenu", | 370 localized_strings.SetString("expandMenu", |
370 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); | 371 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); |
371 #endif | 372 #endif |
372 | 373 |
373 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); | 374 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); |
374 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings); | 375 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings); |
375 | 376 |
376 // Don't initiate the sync related message passing with the page if the sync | 377 // Don't initiate the sync related message passing with the page if the sync |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
548 // Get our template. | 549 // Get our template. |
549 static const base::StringPiece new_tab_theme_css( | 550 static const base::StringPiece new_tab_theme_css( |
550 ResourceBundle::GetSharedInstance().GetRawDataResource( | 551 ResourceBundle::GetSharedInstance().GetRawDataResource( |
551 IDR_NEW_TAB_4_THEME_CSS)); | 552 IDR_NEW_TAB_4_THEME_CSS)); |
552 | 553 |
553 // Create the string from our template and the replacements. | 554 // Create the string from our template and the replacements. |
554 std::string css_string; | 555 std::string css_string; |
555 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 556 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
556 new_tab_css_ = base::RefCountedString::TakeString(&css_string); | 557 new_tab_css_ = base::RefCountedString::TakeString(&css_string); |
557 } | 558 } |
OLD | NEW |