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

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: WeakPtr solution 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 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 {
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | chrome/browser/ui/webui/options2/options_ui2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698