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

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

Issue 9358073: First version of the time slicing on the urls. Not ready for review yet. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added relative time to time slicing Created 8 years, 9 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 <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"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? 285 profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ?
286 "true" : "false"); 286 "true" : "false");
287 localized_strings.SetString("hasattribution", 287 localized_strings.SetString("hasattribution",
288 ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage( 288 ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage(
289 IDR_THEME_NTP_ATTRIBUTION) ? 289 IDR_THEME_NTP_ATTRIBUTION) ?
290 "true" : "false"); 290 "true" : "false");
291 localized_strings.SetString("title", 291 localized_strings.SetString("title",
292 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); 292 l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
293 localized_strings.SetString("mostvisited", 293 localized_strings.SetString("mostvisited",
294 l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED)); 294 l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED));
295 localized_strings.SetString("suggestions",
296 l10n_util::GetStringUTF16(IDS_NEW_TAB_SUGGESTIONS));
295 localized_strings.SetString("restoreThumbnailsShort", 297 localized_strings.SetString("restoreThumbnailsShort",
296 l10n_util::GetStringUTF16(IDS_NEW_TAB_RESTORE_THUMBNAILS_SHORT_LINK)); 298 l10n_util::GetStringUTF16(IDS_NEW_TAB_RESTORE_THUMBNAILS_SHORT_LINK));
297 localized_strings.SetString("recentlyclosed", 299 localized_strings.SetString("recentlyclosed",
298 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED)); 300 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED));
299 localized_strings.SetString("webStoreTitle", 301 localized_strings.SetString("webStoreTitle",
300 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE)); 302 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE));
301 localized_strings.SetString("webStoreTitleShort", 303 localized_strings.SetString("webStoreTitleShort",
302 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE_SHORT)); 304 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE_SHORT));
303 localized_strings.SetString("closedwindowsingle", 305 localized_strings.SetString("closedwindowsingle",
304 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE)); 306 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE));
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 localized_strings.SetString("otherSessions", 339 localized_strings.SetString("otherSessions",
338 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LABEL)); 340 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LABEL));
339 localized_strings.SetString("otherSessionsEmpty", 341 localized_strings.SetString("otherSessionsEmpty",
340 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EMPTY)); 342 l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_EMPTY));
341 localized_strings.SetString("webStoreLink", 343 localized_strings.SetString("webStoreLink",
342 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL()))); 344 GetUrlWithLang(GURL(extension_urls::GetWebstoreLaunchURL())));
343 localized_strings.SetBoolean("isWebStoreExperimentEnabled", 345 localized_strings.SetBoolean("isWebStoreExperimentEnabled",
344 NewTabUI::ShouldShowWebStoreFooterLink()); 346 NewTabUI::ShouldShowWebStoreFooterLink());
345 localized_strings.SetBoolean("appInstallHintEnabled", 347 localized_strings.SetBoolean("appInstallHintEnabled",
346 NewTabUI::ShouldShowAppInstallHint()); 348 NewTabUI::ShouldShowAppInstallHint());
349 localized_strings.SetBoolean("isSuggestionsPageEnabled",
350 NewTabUI::IsSuggestionsPageEnabled());
347 351
348 #if defined(OS_CHROMEOS) 352 #if defined(OS_CHROMEOS)
349 localized_strings.SetString("expandMenu", 353 localized_strings.SetString("expandMenu",
350 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND)); 354 l10n_util::GetStringUTF16(IDS_NEW_TAB_CLOSE_MENU_EXPAND));
351 #endif 355 #endif
352 356
353 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings); 357 NewTabPageHandler::GetLocalizedValues(profile_, &localized_strings);
354 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings); 358 NTPLoginHandler::GetLocalizedValues(profile_, &localized_strings);
355 359
356 // Don't initiate the sync related message passing with the page if the sync 360 // Don't initiate the sync related message passing with the page if the sync
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 // Get our template. 530 // Get our template.
527 static const base::StringPiece new_tab_theme_css( 531 static const base::StringPiece new_tab_theme_css(
528 ResourceBundle::GetSharedInstance().GetRawDataResource( 532 ResourceBundle::GetSharedInstance().GetRawDataResource(
529 IDR_NEW_TAB_4_THEME_CSS)); 533 IDR_NEW_TAB_4_THEME_CSS));
530 534
531 // Create the string from our template and the replacements. 535 // Create the string from our template and the replacements.
532 std::string css_string; 536 std::string css_string;
533 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 537 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
534 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 538 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
535 } 539 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.cc ('k') | chrome/browser/ui/webui/ntp/suggestions_page_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698