Index: chrome/browser/ui/webui/ntp/new_tab_ui.cc |
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
index fc4532901318bb461e3f6afe873b0aa62c71c980..23bd63388e297cc48ddaac20e4102d4dd6492691 100644 |
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
@@ -205,11 +205,18 @@ void NewTabUI::PaintTimeout() { |
void NewTabUI::StartTimingPaint(RenderViewHost* render_view_host) { |
start_ = base::TimeTicks::Now(); |
last_paint_ = start_; |
- registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, |
- content::Source<content::RenderWidgetHost>(render_view_host)); |
+ |
+ content::NotificationSource source = |
+ content::Source<content::RenderWidgetHost>(render_view_host); |
+ if (!registrar_.IsRegistered(this, |
+ content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, |
+ source)) { |
+ registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT, |
+ source); |
+ } |
+ |
timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kTimeoutMs), this, |
&NewTabUI::PaintTimeout); |
- |
} |
bool NewTabUI::CanShowBookmarkBar() const { |