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" | |
11 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
12 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
13 #include "app/theme_provider.h" | 12 #include "app/theme_provider.h" |
14 #include "base/command_line.h" | 13 #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" |
(...skipping 13 matching lines...) Expand all Loading... |
34 #include "chrome/common/notification_service.h" | 33 #include "chrome/common/notification_service.h" |
35 #include "chrome/common/notification_type.h" | 34 #include "chrome/common/notification_type.h" |
36 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
37 #include "chrome/common/url_constants.h" | 36 #include "chrome/common/url_constants.h" |
38 #include "gfx/color_utils.h" | 37 #include "gfx/color_utils.h" |
39 #include "grit/browser_resources.h" | 38 #include "grit/browser_resources.h" |
40 #include "grit/chromium_strings.h" | 39 #include "grit/chromium_strings.h" |
41 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
42 #include "grit/locale_settings.h" | 41 #include "grit/locale_settings.h" |
43 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
| 43 #include "ui/base/animation/animation.h" |
44 | 44 |
45 #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) | 45 #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) |
46 #include "chrome/browser/views/bookmark_bar_view.h" | 46 #include "chrome/browser/views/bookmark_bar_view.h" |
47 #elif defined(OS_MACOSX) | 47 #elif defined(OS_MACOSX) |
48 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" | 48 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" |
49 #elif defined(OS_POSIX) | 49 #elif defined(OS_POSIX) |
50 #include "chrome/browser/gtk/bookmark_bar_gtk.h" | 50 #include "chrome/browser/gtk/bookmark_bar_gtk.h" |
51 #endif | 51 #endif |
52 | 52 |
53 using base::Time; | 53 using base::Time; |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // code is not present. | 345 // code is not present. |
346 if (profile_->GetProfileSyncService()) | 346 if (profile_->GetProfileSyncService()) |
347 localized_strings.SetString("syncispresent", "true"); | 347 localized_strings.SetString("syncispresent", "true"); |
348 else | 348 else |
349 localized_strings.SetString("syncispresent", "false"); | 349 localized_strings.SetString("syncispresent", "false"); |
350 | 350 |
351 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); | 351 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); |
352 | 352 |
353 // Control fade and resize animations. | 353 // Control fade and resize animations. |
354 std::string anim = | 354 std::string anim = |
355 Animation::ShouldRenderRichAnimation() ? "true" : "false"; | 355 ui::Animation::ShouldRenderRichAnimation() ? "true" : "false"; |
356 localized_strings.SetString("anim", anim); | 356 localized_strings.SetString("anim", anim); |
357 | 357 |
358 // Pass the shown_sections pref early so that we can prevent flicker. | 358 // Pass the shown_sections pref early so that we can prevent flicker. |
359 const int shown_sections = ShownSectionsHandler::GetShownSections( | 359 const int shown_sections = ShownSectionsHandler::GetShownSections( |
360 profile_->GetPrefs()); | 360 profile_->GetPrefs()); |
361 localized_strings.SetInteger("shown_sections", shown_sections); | 361 localized_strings.SetInteger("shown_sections", shown_sections); |
362 | 362 |
363 // If the user has preferences for a start and end time for a custom logo, | 363 // If the user has preferences for a start and end time for a custom logo, |
364 // and the time now is between these two times, show the custom logo. | 364 // and the time now is between these two times, show the custom logo. |
365 if (profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoStart) && | 365 if (profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoStart) && |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 std::string css_string; | 547 std::string css_string; |
548 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); | 548 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); |
549 css_string = ReplaceStringPlaceholders(css_string, subst2, NULL); | 549 css_string = ReplaceStringPlaceholders(css_string, subst2, NULL); |
550 css_string = ReplaceStringPlaceholders(css_string, subst3, NULL); | 550 css_string = ReplaceStringPlaceholders(css_string, subst3, NULL); |
551 | 551 |
552 new_tab_css_ = new RefCountedBytes; | 552 new_tab_css_ = new RefCountedBytes; |
553 new_tab_css_->data.resize(css_string.size()); | 553 new_tab_css_->data.resize(css_string.size()); |
554 std::copy(css_string.begin(), css_string.end(), | 554 std::copy(css_string.begin(), css_string.end(), |
555 new_tab_css_->data.begin()); | 555 new_tab_css_->data.begin()); |
556 } | 556 } |
OLD | NEW |