Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 11929016: Move jstemplate_builder.* to ui\webui so it can be reused by webui implementations outside of chrom… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to 177705 to get yfriendman's fix Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 20 matching lines...) Expand all
31 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 31 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
32 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" 32 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h"
33 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" 33 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
34 #include "chrome/browser/ui/webui/sync_setup_handler.h" 34 #include "chrome/browser/ui/webui/sync_setup_handler.h"
35 #include "chrome/browser/ui/webui/web_ui_util.h" 35 #include "chrome/browser/ui/webui/web_ui_util.h"
36 #include "chrome/browser/web_resource/notification_promo.h" 36 #include "chrome/browser/web_resource/notification_promo.h"
37 #include "chrome/common/chrome_notification_types.h" 37 #include "chrome/common/chrome_notification_types.h"
38 #include "chrome/common/chrome_switches.h" 38 #include "chrome/common/chrome_switches.h"
39 #include "chrome/common/extensions/extension.h" 39 #include "chrome/common/extensions/extension.h"
40 #include "chrome/common/extensions/extension_constants.h" 40 #include "chrome/common/extensions/extension_constants.h"
41 #include "chrome/common/jstemplate_builder.h"
42 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
43 #include "chrome/common/url_constants.h" 42 #include "chrome/common/url_constants.h"
44 #include "content/public/browser/browser_thread.h" 43 #include "content/public/browser/browser_thread.h"
45 #include "content/public/browser/notification_service.h" 44 #include "content/public/browser/notification_service.h"
46 #include "grit/browser_resources.h" 45 #include "grit/browser_resources.h"
47 #include "grit/chromium_strings.h" 46 #include "grit/chromium_strings.h"
48 #include "grit/generated_resources.h" 47 #include "grit/generated_resources.h"
49 #include "grit/locale_settings.h" 48 #include "grit/locale_settings.h"
50 #include "grit/theme_resources.h" 49 #include "grit/theme_resources.h"
51 #include "ui/base/animation/animation.h" 50 #include "ui/base/animation/animation.h"
52 #include "ui/base/l10n/l10n_util.h" 51 #include "ui/base/l10n/l10n_util.h"
53 #include "ui/base/resource/resource_bundle.h" 52 #include "ui/base/resource/resource_bundle.h"
54 #include "ui/base/theme_provider.h" 53 #include "ui/base/theme_provider.h"
55 #include "ui/gfx/color_utils.h" 54 #include "ui/gfx/color_utils.h"
56 #include "ui/gfx/sys_color_change_listener.h" 55 #include "ui/gfx/sys_color_change_listener.h"
57 56 #include "ui/webui/jstemplate_builder.h"
58 57
59 #if defined(OS_MACOSX) 58 #if defined(OS_MACOSX)
60 #include "chrome/browser/platform_util.h" 59 #include "chrome/browser/platform_util.h"
61 #endif 60 #endif
62 61
63 using content::BrowserThread; 62 using content::BrowserThread;
64 63
65 namespace { 64 namespace {
66 65
67 // The URL for the the Learn More page shown on incognito new tab. 66 // The URL for the the Learn More page shown on incognito new tab.
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 static const base::StringPiece new_tab_theme_css( 579 static const base::StringPiece new_tab_theme_css(
581 ResourceBundle::GetSharedInstance().GetRawDataResource( 580 ResourceBundle::GetSharedInstance().GetRawDataResource(
582 chrome::search::IsInstantExtendedAPIEnabled(profile_) ? 581 chrome::search::IsInstantExtendedAPIEnabled(profile_) ?
583 IDR_NEW_TAB_SEARCH_THEME_CSS : IDR_NEW_TAB_4_THEME_CSS)); 582 IDR_NEW_TAB_SEARCH_THEME_CSS : IDR_NEW_TAB_4_THEME_CSS));
584 583
585 // Create the string from our template and the replacements. 584 // Create the string from our template and the replacements.
586 std::string css_string; 585 std::string css_string;
587 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 586 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
588 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 587 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
589 } 588 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/media/media_internals_ui.cc ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698