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

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

Issue 2506713002: Avoid parsing the webstore base url so much. (Closed)
Patch Set: fix chromeos Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_FULLSCREEN)); 437 l10n_util::GetStringUTF16(IDS_APP_CONTEXT_MENU_OPEN_FULLSCREEN));
438 load_time_data.SetString("syncpromotext", 438 load_time_data.SetString("syncpromotext",
439 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL)); 439 l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL));
440 load_time_data.SetString("syncLinkText", 440 load_time_data.SetString("syncLinkText",
441 l10n_util::GetStringUTF16(IDS_SYNC_ADVANCED_OPTIONS)); 441 l10n_util::GetStringUTF16(IDS_SYNC_ADVANCED_OPTIONS));
442 load_time_data.SetBoolean("shouldShowSyncLogin", 442 load_time_data.SetBoolean("shouldShowSyncLogin",
443 AppLauncherLoginHandler::ShouldShow(profile_)); 443 AppLauncherLoginHandler::ShouldShow(profile_));
444 load_time_data.SetString("learnMore", 444 load_time_data.SetString("learnMore",
445 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 445 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
446 const std::string& app_locale = g_browser_process->GetApplicationLocale(); 446 const std::string& app_locale = g_browser_process->GetApplicationLocale();
447 load_time_data.SetString("webStoreLink", 447 load_time_data.SetString(
448 google_util::AppendGoogleLocaleParam( 448 "webStoreLink", google_util::AppendGoogleLocaleParam(
449 GURL(extension_urls::GetWebstoreLaunchURL()), app_locale).spec()); 449 extension_urls::GetWebstoreLaunchURL(), app_locale)
450 .spec());
450 load_time_data.SetString("appInstallHintText", 451 load_time_data.SetString("appInstallHintText",
451 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL)); 452 l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL));
452 load_time_data.SetString("learn_more", 453 load_time_data.SetString("learn_more",
453 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); 454 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
454 load_time_data.SetString("tile_grid_screenreader_accessible_description", 455 load_time_data.SetString("tile_grid_screenreader_accessible_description",
455 l10n_util::GetStringUTF16(IDS_NEW_TAB_TILE_GRID_ACCESSIBLE_DESCRIPTION)); 456 l10n_util::GetStringUTF16(IDS_NEW_TAB_TILE_GRID_ACCESSIBLE_DESCRIPTION));
456 load_time_data.SetString("page_switcher_change_title", 457 load_time_data.SetString("page_switcher_change_title",
457 l10n_util::GetStringUTF16(IDS_NEW_TAB_PAGE_SWITCHER_CHANGE_TITLE)); 458 l10n_util::GetStringUTF16(IDS_NEW_TAB_PAGE_SWITCHER_CHANGE_TITLE));
458 load_time_data.SetString("page_switcher_same_title", 459 load_time_data.SetString("page_switcher_same_title",
459 l10n_util::GetStringUTF16(IDS_NEW_TAB_PAGE_SWITCHER_SAME_TITLE)); 460 l10n_util::GetStringUTF16(IDS_NEW_TAB_PAGE_SWITCHER_SAME_TITLE));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // Get our template. 602 // Get our template.
602 static const base::StringPiece new_tab_theme_css( 603 static const base::StringPiece new_tab_theme_css(
603 ResourceBundle::GetSharedInstance().GetRawDataResource( 604 ResourceBundle::GetSharedInstance().GetRawDataResource(
604 IDR_NEW_TAB_4_THEME_CSS)); 605 IDR_NEW_TAB_4_THEME_CSS));
605 606
606 // Create the string from our template and the replacements. 607 // Create the string from our template and the replacements.
607 std::string css_string = 608 std::string css_string =
608 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); 609 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions);
609 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 610 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
610 } 611 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698