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 547f347c0765c69c40ec2592059af75f0e350acd..350e45ef3745b9c8af78b4065a062f9567ea1391 100644 |
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc |
@@ -203,11 +203,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); |
stuartmorgan
2012/04/24 09:12:20
Is doing all this timer stuff a second time okay?
Evan Stade
2012/04/24 17:52:40
as far as calling start more than once, yea it's o
|
- |
} |
bool NewTabUI::CanShowBookmarkBar() const { |