OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |