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

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

Issue 1440113002: [MD] Change appearance of incognito NTP to MD spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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 (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/new_tab_ui.h" 5 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // We might not have an ExtensionService (on ChromeOS when not logged in 101 // We might not have an ExtensionService (on ChromeOS when not logged in
102 // for example). 102 // for example).
103 if (service) 103 if (service)
104 web_ui->AddMessageHandler(new AppLauncherHandler(service)); 104 web_ui->AddMessageHandler(new AppLauncherHandler(service));
105 } 105 }
106 106
107 #if defined(ENABLE_THEMES) 107 #if defined(ENABLE_THEMES)
108 // The theme handler can require some CPU, so do it after hooking up the most 108 // The theme handler can require some CPU, so do it after hooking up the most
109 // visited handler. This allows the DB query for the new tab thumbs to happen 109 // visited handler. This allows the DB query for the new tab thumbs to happen
110 // earlier. 110 // earlier.
111 web_ui->AddMessageHandler(new ThemeHandler()); 111 if (!profile->IsGuestSession())
112 web_ui->AddMessageHandler(new ThemeHandler());
112 #endif 113 #endif
113 114
114 scoped_ptr<NewTabHTMLSource> html_source( 115 scoped_ptr<NewTabHTMLSource> html_source(
115 new NewTabHTMLSource(profile->GetOriginalProfile())); 116 new NewTabHTMLSource(profile->GetOriginalProfile()));
116 117
117 // content::URLDataSource assumes the ownership of the html_source. 118 // content::URLDataSource assumes the ownership of the html_source.
118 content::URLDataSource::Add(profile, html_source.release()); 119 content::URLDataSource::Add(profile, html_source.release());
119 120
120 pref_change_registrar_.Init(profile->GetPrefs()); 121 pref_change_registrar_.Init(profile->GetPrefs());
121 pref_change_registrar_.Add(bookmarks::prefs::kShowBookmarkBar, 122 pref_change_registrar_.Add(bookmarks::prefs::kShowBookmarkBar,
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, 341 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource,
341 const char* mime_type, 342 const char* mime_type,
342 int resource_id) { 343 int resource_id) {
343 DCHECK(resource); 344 DCHECK(resource);
344 DCHECK(mime_type); 345 DCHECK(mime_type);
345 resource_map_[std::string(resource)] = 346 resource_map_[std::string(resource)] =
346 std::make_pair(std::string(mime_type), resource_id); 347 std::make_pair(std::string(mime_type), resource_id);
347 } 348 }
348 349
349 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} 350 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {}
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.js ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698