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

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

Issue 13926002: Always show the NTP apps page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 7 years, 8 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
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "apps/app_launcher.h" 10 #include "apps/app_launcher.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 bool NTPResourceCache::NewTabCacheNeedsRefresh() { 208 bool NTPResourceCache::NewTabCacheNeedsRefresh() {
209 #if defined(OS_MACOSX) 209 #if defined(OS_MACOSX)
210 // Invalidate if the current value is different from the cached value. 210 // Invalidate if the current value is different from the cached value.
211 bool is_enabled = platform_util::IsSwipeTrackingFromScrollEventsEnabled(); 211 bool is_enabled = platform_util::IsSwipeTrackingFromScrollEventsEnabled();
212 if (is_enabled != is_swipe_tracking_from_scroll_events_enabled_) { 212 if (is_enabled != is_swipe_tracking_from_scroll_events_enabled_) {
213 is_swipe_tracking_from_scroll_events_enabled_ = is_enabled; 213 is_swipe_tracking_from_scroll_events_enabled_ = is_enabled;
214 return true; 214 return true;
215 } 215 }
216 #endif 216 #endif
217 bool should_show_apps_page = !apps::WasAppLauncherEnabled(); 217 bool should_show_apps_page = NewTabUI::ShouldShowApps();
218 if (should_show_apps_page != should_show_apps_page_) { 218 if (should_show_apps_page != should_show_apps_page_) {
219 should_show_apps_page_ = should_show_apps_page; 219 should_show_apps_page_ = should_show_apps_page;
220 return true; 220 return true;
221 } 221 }
222 return false; 222 return false;
223 } 223 }
224 224
225 base::RefCountedMemory* NTPResourceCache::GetNewTabHTML(bool is_incognito) { 225 base::RefCountedMemory* NTPResourceCache::GetNewTabHTML(bool is_incognito) {
226 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 226 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
227 if (is_incognito) { 227 if (is_incognito) {
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 // Get our template. 620 // Get our template.
621 static const base::StringPiece new_tab_theme_css( 621 static const base::StringPiece new_tab_theme_css(
622 ResourceBundle::GetSharedInstance().GetRawDataResource( 622 ResourceBundle::GetSharedInstance().GetRawDataResource(
623 IDR_NEW_TAB_4_THEME_CSS)); 623 IDR_NEW_TAB_4_THEME_CSS));
624 624
625 // Create the string from our template and the replacements. 625 // Create the string from our template and the replacements.
626 std::string css_string; 626 std::string css_string;
627 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 627 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
628 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 628 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
629 } 629 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698