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

Unified Diff: chrome/browser/webui/chrome_url_data_manager_backend.cc

Issue 6546078: Makes a handful of DataSources not replace the existing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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/webui/chrome_url_data_manager_backend.cc
diff --git a/chrome/browser/webui/chrome_url_data_manager_backend.cc b/chrome/browser/webui/chrome_url_data_manager_backend.cc
index e484a052909d48530f5aa0a1d9f7df2bf21c6418..1f3d73bc874390ab887248f2b85f4bb904c63baa 100644
--- a/chrome/browser/webui/chrome_url_data_manager_backend.cc
+++ b/chrome/browser/webui/chrome_url_data_manager_backend.cc
@@ -178,8 +178,11 @@ void ChromeURLDataManagerBackend::AddDataSource(
ChromeURLDataManager::DataSource* source) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DataSourceMap::iterator i = data_sources_.find(source->source_name());
- if (i != data_sources_.end())
+ if (i != data_sources_.end()) {
+ if (!source->ShouldReplaceExistingSource())
+ return;
i->second->backend_ = NULL;
+ }
data_sources_[source->source_name()] = source;
source->backend_ = this;
}

Powered by Google App Engine
This is Rietveld 408576698