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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 10154004: re-use WebUIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix reload DCHECKs Created 8 years, 8 months 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 side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698