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

Unified Diff: chrome/browser/ui/webui/sync_internals_message_handler.cc

Issue 2388163002: [Sync] Move //components/sync to the syncer namespace, take 2. (Closed)
Patch Set: Rebase. Created 4 years, 2 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/sync_internals_message_handler.cc
diff --git a/chrome/browser/ui/webui/sync_internals_message_handler.cc b/chrome/browser/ui/webui/sync_internals_message_handler.cc
index ab914568b00e7837c47a77b98227550133c96c2f..ea7e1aeb499ce0a3d5b422d7728d8bfa0d416da0 100644
--- a/chrome/browser/ui/webui/sync_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/sync_internals_message_handler.cc
@@ -34,9 +34,9 @@ namespace {
class UtilAboutSyncDataExtractor : public AboutSyncDataExtractor {
public:
std::unique_ptr<base::DictionaryValue> ConstructAboutInformation(
- sync_driver::SyncService* service,
+ syncer::SyncService* service,
SigninManagerBase* signin) override {
- return sync_driver::sync_ui_util::ConstructAboutInformation(
+ return syncer::sync_ui_util::ConstructAboutInformation(
service, signin, chrome::GetChannel());
}
};
@@ -70,27 +70,27 @@ void SyncInternalsMessageHandler::RegisterMessages() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
web_ui()->RegisterMessageCallback(
- sync_driver::sync_ui_util::kRegisterForEvents,
+ syncer::sync_ui_util::kRegisterForEvents,
base::Bind(&SyncInternalsMessageHandler::HandleRegisterForEvents,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
- sync_driver::sync_ui_util::kRegisterForPerTypeCounters,
+ syncer::sync_ui_util::kRegisterForPerTypeCounters,
base::Bind(&SyncInternalsMessageHandler::HandleRegisterForPerTypeCounters,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
- sync_driver::sync_ui_util::kRequestUpdatedAboutInfo,
+ syncer::sync_ui_util::kRequestUpdatedAboutInfo,
base::Bind(&SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
- sync_driver::sync_ui_util::kRequestListOfTypes,
+ syncer::sync_ui_util::kRequestListOfTypes,
base::Bind(&SyncInternalsMessageHandler::HandleRequestListOfTypes,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
- sync_driver::sync_ui_util::kGetAllNodes,
+ syncer::sync_ui_util::kGetAllNodes,
base::Bind(&SyncInternalsMessageHandler::HandleGetAllNodes,
base::Unretained(this)));
}
@@ -144,10 +144,10 @@ void SyncInternalsMessageHandler::HandleRequestListOfTypes(
it.Good(); it.Inc()) {
type_list->AppendString(ModelTypeToString(it.Get()));
}
- event_details.Set(sync_driver::sync_ui_util::kTypes, type_list.release());
+ event_details.Set(syncer::sync_ui_util::kTypes, type_list.release());
web_ui()->CallJavascriptFunctionUnsafe(
- sync_driver::sync_ui_util::kDispatchEvent,
- base::StringValue(sync_driver::sync_ui_util::kOnReceivedListOfTypes),
+ syncer::sync_ui_util::kDispatchEvent,
+ base::StringValue(syncer::sync_ui_util::kOnReceivedListOfTypes),
event_details);
}
@@ -171,7 +171,7 @@ void SyncInternalsMessageHandler::OnReceivedAllNodes(
std::unique_ptr<base::ListValue> nodes) {
base::FundamentalValue id(request_id);
web_ui()->CallJavascriptFunctionUnsafe(
- sync_driver::sync_ui_util::kGetAllNodesCallback, id, *nodes);
+ syncer::sync_ui_util::kGetAllNodesCallback, id, *nodes);
}
void SyncInternalsMessageHandler::OnStateChanged() {
@@ -183,29 +183,26 @@ void SyncInternalsMessageHandler::OnProtocolEvent(
std::unique_ptr<base::DictionaryValue> value(
syncer::ProtocolEvent::ToValue(event));
web_ui()->CallJavascriptFunctionUnsafe(
- sync_driver::sync_ui_util::kDispatchEvent,
- base::StringValue(sync_driver::sync_ui_util::kOnProtocolEvent), *value);
+ syncer::sync_ui_util::kDispatchEvent,
+ base::StringValue(syncer::sync_ui_util::kOnProtocolEvent), *value);
}
void SyncInternalsMessageHandler::OnCommitCountersUpdated(
syncer::ModelType type,
const syncer::CommitCounters& counters) {
- EmitCounterUpdate(type, sync_driver::sync_ui_util::kCommit,
- counters.ToValue());
+ EmitCounterUpdate(type, syncer::sync_ui_util::kCommit, counters.ToValue());
}
void SyncInternalsMessageHandler::OnUpdateCountersUpdated(
syncer::ModelType type,
const syncer::UpdateCounters& counters) {
- EmitCounterUpdate(type, sync_driver::sync_ui_util::kUpdate,
- counters.ToValue());
+ EmitCounterUpdate(type, syncer::sync_ui_util::kUpdate, counters.ToValue());
}
void SyncInternalsMessageHandler::OnStatusCountersUpdated(
syncer::ModelType type,
const syncer::StatusCounters& counters) {
- EmitCounterUpdate(type, sync_driver::sync_ui_util::kStatus,
- counters.ToValue());
+ EmitCounterUpdate(type, syncer::sync_ui_util::kStatus, counters.ToValue());
}
void SyncInternalsMessageHandler::EmitCounterUpdate(
@@ -213,14 +210,12 @@ void SyncInternalsMessageHandler::EmitCounterUpdate(
const std::string& counter_type,
std::unique_ptr<base::DictionaryValue> value) {
std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue());
- details->SetString(sync_driver::sync_ui_util::kModelType,
- ModelTypeToString(type));
- details->SetString(sync_driver::sync_ui_util::kCounterType, counter_type);
- details->Set(sync_driver::sync_ui_util::kCounters, value.release());
+ details->SetString(syncer::sync_ui_util::kModelType, ModelTypeToString(type));
+ details->SetString(syncer::sync_ui_util::kCounterType, counter_type);
+ details->Set(syncer::sync_ui_util::kCounters, value.release());
web_ui()->CallJavascriptFunctionUnsafe(
- sync_driver::sync_ui_util::kDispatchEvent,
- base::StringValue(sync_driver::sync_ui_util::kOnCountersUpdated),
- *details);
+ syncer::sync_ui_util::kDispatchEvent,
+ base::StringValue(syncer::sync_ui_util::kOnCountersUpdated), *details);
}
void SyncInternalsMessageHandler::HandleJsEvent(
@@ -228,9 +223,9 @@ void SyncInternalsMessageHandler::HandleJsEvent(
const JsEventDetails& details) {
DVLOG(1) << "Handling event: " << name
<< " with details " << details.ToString();
- web_ui()->CallJavascriptFunctionUnsafe(
- sync_driver::sync_ui_util::kDispatchEvent, base::StringValue(name),
- details.Get());
+ web_ui()->CallJavascriptFunctionUnsafe(syncer::sync_ui_util::kDispatchEvent,
+ base::StringValue(name),
+ details.Get());
}
void SyncInternalsMessageHandler::SendAboutInfo() {
@@ -240,9 +235,8 @@ void SyncInternalsMessageHandler::SendAboutInfo() {
about_sync_data_extractor_->ConstructAboutInformation(sync_service,
signin);
web_ui()->CallJavascriptFunctionUnsafe(
- sync_driver::sync_ui_util::kDispatchEvent,
- base::StringValue(sync_driver::sync_ui_util::kOnAboutInfoUpdated),
- *value);
+ syncer::sync_ui_util::kDispatchEvent,
+ base::StringValue(syncer::sync_ui_util::kOnAboutInfoUpdated), *value);
}
// Gets the ProfileSyncService of the underlying original profile.

Powered by Google App Engine
This is Rietveld 408576698