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

Unified Diff: content/browser/webui/url_data_manager_backend.cc

Issue 2475593002: MD History: update (instead of re-create) data sources on sign in change (Closed)
Patch Set: old history as well Created 4 years, 1 month 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: content/browser/webui/url_data_manager_backend.cc
diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc
index 72c035a202690072a8a5789af9f8033c0245e167..936316fccce2cd3e8127b7ca4834f7a4e6b843f5 100644
--- a/content/browser/webui/url_data_manager_backend.cc
+++ b/content/browser/webui/url_data_manager_backend.cc
@@ -33,6 +33,7 @@
#include "content/browser/resource_context_impl.h"
#include "content/browser/webui/shared_resources_data_source.h"
#include "content/browser/webui/url_data_source_impl.h"
+#include "content/browser/webui/web_ui_data_source_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -650,6 +651,18 @@ void URLDataManagerBackend::AddDataSource(
source->backend_ = this;
}
+void URLDataManagerBackend::UpdateWebUIDataSource(
+ const std::string& source_name,
+ const base::DictionaryValue& update) {
+ DataSourceMap::iterator it = data_sources_.find(source_name);
+ if (it == data_sources_.end() || !it->second->IsWebUIDataSourceImpl()) {
calamity 2016/11/16 05:36:13 Why can't non WebUI data sources be updated?
Dan Beam 2016/11/16 06:02:03 we're only sending updates to the localized "strin
+ NOTREACHED();
+ return;
+ }
+ static_cast<WebUIDataSourceImpl*>(it->second.get())
+ ->AddLocalizedStrings(update);
+}
+
bool URLDataManagerBackend::HasPendingJob(
URLRequestChromeJob* job) const {
for (PendingRequestMap::const_iterator i = pending_requests_.begin();

Powered by Google App Engine
This is Rietveld 408576698