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

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: Merge with trunk and apply tweaks from flackr CR 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 148
149 void NewTabUI::StartTimingPaint(RenderViewHost* render_view_host) { 149 void NewTabUI::StartTimingPaint(RenderViewHost* render_view_host) {
150 start_ = base::TimeTicks::Now(); 150 start_ = base::TimeTicks::Now();
151 last_paint_ = start_; 151 last_paint_ = start_;
152 registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, 152 registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT,
153 content::Source<RenderWidgetHost>(render_view_host)); 153 content::Source<RenderWidgetHost>(render_view_host));
154 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kTimeoutMs), this, 154 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kTimeoutMs), this,
155 &NewTabUI::PaintTimeout); 155 &NewTabUI::PaintTimeout);
156 156
157 } 157 }
Evan Stade 2011/11/30 23:36:09 \n
Rick Byers 2011/12/01 01:29:24 Done.
158 void NewTabUI::RenderViewCreated(RenderViewHost* render_view_host) { 158 void NewTabUI::RenderViewCreated(RenderViewHost* render_view_host) {
159 StartTimingPaint(render_view_host); 159 StartTimingPaint(render_view_host);
160 ChromeWebUI::RenderViewCreated(render_view_host);
160 } 161 }
161 162
162 void NewTabUI::RenderViewReused(RenderViewHost* render_view_host) { 163 void NewTabUI::RenderViewReused(RenderViewHost* render_view_host) {
163 StartTimingPaint(render_view_host); 164 StartTimingPaint(render_view_host);
165 ChromeWebUI::RenderViewReused(render_view_host);
164 } 166 }
165 167
166 bool NewTabUI::CanShowBookmarkBar() const { 168 bool NewTabUI::CanShowBookmarkBar() const {
167 PrefService* prefs = GetProfile()->GetPrefs(); 169 PrefService* prefs = GetProfile()->GetPrefs();
168 bool disabled_by_policy = 170 bool disabled_by_policy =
169 prefs->IsManagedPreference(prefs::kShowBookmarkBar) && 171 prefs->IsManagedPreference(prefs::kShowBookmarkBar) &&
170 !prefs->GetBoolean(prefs::kShowBookmarkBar); 172 !prefs->GetBoolean(prefs::kShowBookmarkBar);
171 return browser_defaults::bookmarks_enabled && 173 return browser_defaults::bookmarks_enabled &&
172 !disabled_by_policy && 174 !disabled_by_policy &&
173 !NTP4BookmarkFeaturesEnabled(); 175 !NTP4BookmarkFeaturesEnabled();
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 SendResponse(request_id, html_bytes); 281 SendResponse(request_id, html_bytes);
280 } 282 }
281 283
282 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { 284 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const {
283 return "text/html"; 285 return "text/html";
284 } 286 }
285 287
286 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { 288 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const {
287 return false; 289 return false;
288 } 290 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698