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

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

Issue 8695007: Replace TOUCH_UI condition in WebUI with dynamic flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove languages tweak and fix keyboard Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 start_ = base::TimeTicks::Now(); 155 start_ = base::TimeTicks::Now();
156 last_paint_ = start_; 156 last_paint_ = start_;
157 registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, 157 registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT,
158 content::Source<RenderWidgetHost>(render_view_host)); 158 content::Source<RenderWidgetHost>(render_view_host));
159 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kTimeoutMs), this, 159 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kTimeoutMs), this,
160 &NewTabUI::PaintTimeout); 160 &NewTabUI::PaintTimeout);
161 161
162 } 162 }
163 void NewTabUI::RenderViewCreated(RenderViewHost* render_view_host) { 163 void NewTabUI::RenderViewCreated(RenderViewHost* render_view_host) {
164 StartTimingPaint(render_view_host); 164 StartTimingPaint(render_view_host);
165 ChromeWebUI::RenderViewCreated(render_view_host);
165 } 166 }
166 167
167 void NewTabUI::RenderViewReused(RenderViewHost* render_view_host) { 168 void NewTabUI::RenderViewReused(RenderViewHost* render_view_host) {
168 StartTimingPaint(render_view_host); 169 StartTimingPaint(render_view_host);
170 ChromeWebUI::RenderViewReused(render_view_host);
169 } 171 }
170 172
171 bool NewTabUI::CanShowBookmarkBar() const { 173 bool NewTabUI::CanShowBookmarkBar() const {
172 PrefService* prefs = GetProfile()->GetPrefs(); 174 PrefService* prefs = GetProfile()->GetPrefs();
173 bool disabled_by_policy = 175 bool disabled_by_policy =
174 prefs->IsManagedPreference(prefs::kShowBookmarkBar) && 176 prefs->IsManagedPreference(prefs::kShowBookmarkBar) &&
175 !prefs->GetBoolean(prefs::kShowBookmarkBar); 177 !prefs->GetBoolean(prefs::kShowBookmarkBar);
176 return browser_defaults::bookmarks_enabled && 178 return browser_defaults::bookmarks_enabled &&
177 !disabled_by_policy && 179 !disabled_by_policy &&
178 !NTP4BookmarkFeaturesEnabled(); 180 !NTP4BookmarkFeaturesEnabled();
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 SendResponse(request_id, html_bytes); 311 SendResponse(request_id, html_bytes);
310 } 312 }
311 313
312 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { 314 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const {
313 return "text/html"; 315 return "text/html";
314 } 316 }
315 317
316 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { 318 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const {
317 return false; 319 return false;
318 } 320 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698