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

Unified Diff: chrome/browser/ui/webui/downloads_dom_handler.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/downloads_dom_handler.cc
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index a96ebd157ca1a0a54592117e60b798d08c13fccd..0b11da7c6ec73aa2e13034164daa2db1f2c3acac 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -92,6 +92,7 @@ DownloadsDOMHandler::DownloadsDOMHandler(content::DownloadManager* dlm)
: search_text_(),
download_manager_(dlm),
original_profile_download_manager_(NULL),
+ initialized_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
// Create our fileicon data source.
Profile::FromBrowserContext(dlm->GetBrowserContext())->
@@ -117,6 +118,10 @@ DownloadsDOMHandler::~DownloadsDOMHandler() {
// DownloadsDOMHandler, public: -----------------------------------------------
void DownloadsDOMHandler::OnPageLoaded(const base::ListValue* args) {
+ if (initialized_)
+ return;
+ initialized_ = true;
+
download_manager_->AddObserver(this);
if (original_profile_download_manager_)
original_profile_download_manager_->AddObserver(this);

Powered by Google App Engine
This is Rietveld 408576698