Commit d486d6f9 authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

Remove Types tab in chrome://sync-internals

This debugging page hasn't been used by the Sync team in a while, so
this CL removes it. Consequently, SyncInternalsMessageHandler no longer
needs to implement TypeDebugInfoObserver. This unblocks the removal of
such observer interface in future CLs (chrome://sync-internals was its
last "real" implementation).

Bug: 1102849
Change-Id: Idb2ed8af56c9133a884b79ccfa131dce630fa1bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2465743Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#816131}
parent 86a76215
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
#include "components/sync/driver/sync_driver_switches.h" #include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h" #include "components/sync/driver/sync_user_settings.h"
#include "components/sync/engine/cycle/commit_counters.h"
#include "components/sync/engine/cycle/status_counters.h"
#include "components/sync/engine/cycle/update_counters.h"
#include "components/sync/engine/events/protocol_event.h" #include "components/sync/engine/events/protocol_event.h"
#include "components/sync/js/js_event_details.h" #include "components/sync/js/js_event_details.h"
#include "components/sync/protocol/sync.pb.h" #include "components/sync/protocol/sync.pb.h"
...@@ -96,12 +93,6 @@ void SyncInternalsMessageHandler::RegisterMessages() { ...@@ -96,12 +93,6 @@ void SyncInternalsMessageHandler::RegisterMessages() {
base::BindRepeating(&SyncInternalsMessageHandler::HandleRegisterForEvents, base::BindRepeating(&SyncInternalsMessageHandler::HandleRegisterForEvents,
base::Unretained(this))); base::Unretained(this)));
web_ui()->RegisterMessageCallback(
syncer::sync_ui_util::kRegisterForPerTypeCounters,
base::BindRepeating(
&SyncInternalsMessageHandler::HandleRegisterForPerTypeCounters,
base::Unretained(this)));
web_ui()->RegisterMessageCallback( web_ui()->RegisterMessageCallback(
syncer::sync_ui_util::kRequestUpdatedAboutInfo, syncer::sync_ui_util::kRequestUpdatedAboutInfo,
base::BindRepeating( base::BindRepeating(
...@@ -183,25 +174,6 @@ void SyncInternalsMessageHandler::HandleRegisterForEvents( ...@@ -183,25 +174,6 @@ void SyncInternalsMessageHandler::HandleRegisterForEvents(
} }
} }
void SyncInternalsMessageHandler::HandleRegisterForPerTypeCounters(
const ListValue* args) {
DCHECK(args->empty());
AllowJavascript();
SyncService* service = GetSyncService();
if (!service)
return;
if (!is_registered_for_counters_) {
service->AddTypeDebugInfoObserver(this);
is_registered_for_counters_ = true;
} else {
// Re-register to ensure counters get re-emitted.
service->RemoveTypeDebugInfoObserver(this);
service->AddTypeDebugInfoObserver(this);
}
}
void SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo( void SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo(
const ListValue* args) { const ListValue* args) {
DCHECK(args->empty()); DCHECK(args->empty());
...@@ -366,35 +338,6 @@ void SyncInternalsMessageHandler::OnProtocolEvent( ...@@ -366,35 +338,6 @@ void SyncInternalsMessageHandler::OnProtocolEvent(
DispatchEvent(syncer::sync_ui_util::kOnProtocolEvent, *value); DispatchEvent(syncer::sync_ui_util::kOnProtocolEvent, *value);
} }
void SyncInternalsMessageHandler::OnCommitCountersUpdated(
syncer::ModelType type,
const syncer::CommitCounters& counters) {
EmitCounterUpdate(type, syncer::sync_ui_util::kCommit, counters.ToValue());
}
void SyncInternalsMessageHandler::OnUpdateCountersUpdated(
syncer::ModelType type,
const syncer::UpdateCounters& counters) {
EmitCounterUpdate(type, syncer::sync_ui_util::kUpdate, counters.ToValue());
}
void SyncInternalsMessageHandler::OnStatusCountersUpdated(
syncer::ModelType type,
const syncer::StatusCounters& counters) {
EmitCounterUpdate(type, syncer::sync_ui_util::kStatus, counters.ToValue());
}
void SyncInternalsMessageHandler::EmitCounterUpdate(
syncer::ModelType type,
const std::string& counter_type,
std::unique_ptr<DictionaryValue> value) {
auto details = std::make_unique<DictionaryValue>();
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, std::move(value));
DispatchEvent(syncer::sync_ui_util::kOnCountersUpdated, *details);
}
void SyncInternalsMessageHandler::HandleJsEvent( void SyncInternalsMessageHandler::HandleJsEvent(
const std::string& name, const std::string& name,
const syncer::JsEventDetails& details) { const syncer::JsEventDetails& details) {
...@@ -435,9 +378,4 @@ void SyncInternalsMessageHandler::UnregisterModelNotifications() { ...@@ -435,9 +378,4 @@ void SyncInternalsMessageHandler::UnregisterModelNotifications() {
js_controller_ = nullptr; js_controller_ = nullptr;
is_registered_ = false; is_registered_ = false;
} }
if (is_registered_for_counters_) {
service->RemoveTypeDebugInfoObserver(this);
is_registered_for_counters_ = false;
}
} }
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/values.h" #include "base/values.h"
#include "components/sync/driver/sync_service_observer.h" #include "components/sync/driver/sync_service_observer.h"
#include "components/sync/engine/cycle/type_debug_info_observer.h"
#include "components/sync/engine/events/protocol_event_observer.h" #include "components/sync/engine/events/protocol_event_observer.h"
#include "components/sync/js/js_controller.h" #include "components/sync/js/js_controller.h"
#include "components/sync/js/js_event_handler.h" #include "components/sync/js/js_event_handler.h"
...@@ -27,8 +26,7 @@ class SyncService; ...@@ -27,8 +26,7 @@ class SyncService;
class SyncInternalsMessageHandler : public content::WebUIMessageHandler, class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
public syncer::JsEventHandler, public syncer::JsEventHandler,
public syncer::SyncServiceObserver, public syncer::SyncServiceObserver,
public syncer::ProtocolEventObserver, public syncer::ProtocolEventObserver {
public syncer::TypeDebugInfoObserver {
public: public:
SyncInternalsMessageHandler(); SyncInternalsMessageHandler();
~SyncInternalsMessageHandler() override; ~SyncInternalsMessageHandler() override;
...@@ -40,9 +38,6 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler, ...@@ -40,9 +38,6 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
// Sets up observers to receive events and forward them to the UI. // Sets up observers to receive events and forward them to the UI.
void HandleRegisterForEvents(const base::ListValue* args); void HandleRegisterForEvents(const base::ListValue* args);
// Sets up observers to receive per-type counters and forward them to the UI.
void HandleRegisterForPerTypeCounters(const base::ListValue* args);
// Fires an event to send updated info back to the page. // Fires an event to send updated info back to the page.
void HandleRequestUpdatedAboutInfo(const base::ListValue* args); void HandleRequestUpdatedAboutInfo(const base::ListValue* args);
...@@ -91,23 +86,6 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler, ...@@ -91,23 +86,6 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
// syncer::ProtocolEventObserver implementation. // syncer::ProtocolEventObserver implementation.
void OnProtocolEvent(const syncer::ProtocolEvent& e) override; void OnProtocolEvent(const syncer::ProtocolEvent& e) override;
// syncer::TypeDebugInfoObserver implementation.
void OnCommitCountersUpdated(syncer::ModelType type,
const syncer::CommitCounters& counters) override;
void OnUpdateCountersUpdated(syncer::ModelType type,
const syncer::UpdateCounters& counters) override;
void OnStatusCountersUpdated(syncer::ModelType type,
const syncer::StatusCounters& counters) override;
// Helper to emit counter updates.
//
// Used in implementation of On*CounterUpdated methods. Emits the given
// dictionary value with additional data to specify the model type and
// counter type.
void EmitCounterUpdate(syncer::ModelType type,
const std::string& counter_type,
std::unique_ptr<base::DictionaryValue> value);
protected: protected:
using AboutSyncDataDelegate = using AboutSyncDataDelegate =
base::RepeatingCallback<std::unique_ptr<base::DictionaryValue>( base::RepeatingCallback<std::unique_ptr<base::DictionaryValue>(
...@@ -139,10 +117,6 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler, ...@@ -139,10 +117,6 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
// A flag used to prevent double-registration with ProfileSyncService. // A flag used to prevent double-registration with ProfileSyncService.
bool is_registered_ = false; bool is_registered_ = false;
// A flag used to prevent double-registration as TypeDebugInfoObserver with
// ProfileSyncService.
bool is_registered_for_counters_ = false;
// Whether specifics should be included when converting protocol events to a // Whether specifics should be included when converting protocol events to a
// human readable format. // human readable format.
bool include_specifics_ = false; bool include_specifics_ = false;
......
...@@ -29,7 +29,6 @@ using sync_pb::UserEventSpecifics; ...@@ -29,7 +29,6 @@ using sync_pb::UserEventSpecifics;
using syncer::FakeUserEventService; using syncer::FakeUserEventService;
using syncer::SyncService; using syncer::SyncService;
using syncer::SyncServiceObserver; using syncer::SyncServiceObserver;
using syncer::TypeDebugInfoObserver;
namespace { namespace {
...@@ -53,14 +52,6 @@ class TestSyncService : public syncer::FakeSyncService { ...@@ -53,14 +52,6 @@ class TestSyncService : public syncer::FakeSyncService {
++remove_observer_count_; ++remove_observer_count_;
} }
void AddTypeDebugInfoObserver(TypeDebugInfoObserver* observer) override {
++add_type_debug_info_observer_count_;
}
void RemoveTypeDebugInfoObserver(TypeDebugInfoObserver* observer) override {
++remove_type_debug_info_observer_count_;
}
base::WeakPtr<syncer::JsController> GetJsController() override { base::WeakPtr<syncer::JsController> GetJsController() override {
return js_controller_.AsWeakPtr(); return js_controller_.AsWeakPtr();
} }
...@@ -73,12 +64,6 @@ class TestSyncService : public syncer::FakeSyncService { ...@@ -73,12 +64,6 @@ class TestSyncService : public syncer::FakeSyncService {
int add_observer_count() const { return add_observer_count_; } int add_observer_count() const { return add_observer_count_; }
int remove_observer_count() const { return remove_observer_count_; } int remove_observer_count() const { return remove_observer_count_; }
int add_type_debug_info_observer_count() const {
return add_type_debug_info_observer_count_;
}
int remove_type_debug_info_observer_count() const {
return remove_type_debug_info_observer_count_;
}
base::OnceCallback<void(std::unique_ptr<base::ListValue>)> base::OnceCallback<void(std::unique_ptr<base::ListValue>)>
get_all_nodes_callback() { get_all_nodes_callback() {
return std::move(get_all_nodes_callback_); return std::move(get_all_nodes_callback_);
...@@ -87,8 +72,6 @@ class TestSyncService : public syncer::FakeSyncService { ...@@ -87,8 +72,6 @@ class TestSyncService : public syncer::FakeSyncService {
private: private:
int add_observer_count_ = 0; int add_observer_count_ = 0;
int remove_observer_count_ = 0; int remove_observer_count_ = 0;
int add_type_debug_info_observer_count_ = 0;
int remove_type_debug_info_observer_count_ = 0;
syncer::MockJsController js_controller_; syncer::MockJsController js_controller_;
base::OnceCallback<void(std::unique_ptr<base::ListValue>)> base::OnceCallback<void(std::unique_ptr<base::ListValue>)>
get_all_nodes_callback_; get_all_nodes_callback_;
...@@ -219,19 +202,12 @@ TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObservers) { ...@@ -219,19 +202,12 @@ TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObservers) {
handler()->HandleRegisterForEvents(&empty_list); handler()->HandleRegisterForEvents(&empty_list);
EXPECT_EQ(1, test_sync_service()->add_observer_count()); EXPECT_EQ(1, test_sync_service()->add_observer_count());
EXPECT_EQ(0, test_sync_service()->add_type_debug_info_observer_count());
handler()->HandleRegisterForPerTypeCounters(&empty_list);
EXPECT_EQ(1, test_sync_service()->add_type_debug_info_observer_count());
EXPECT_EQ(0, test_sync_service()->remove_observer_count()); EXPECT_EQ(0, test_sync_service()->remove_observer_count());
EXPECT_EQ(0, test_sync_service()->remove_type_debug_info_observer_count());
ResetHandler(); ResetHandler();
EXPECT_EQ(1, test_sync_service()->remove_observer_count()); EXPECT_EQ(1, test_sync_service()->remove_observer_count());
EXPECT_EQ(1, test_sync_service()->remove_type_debug_info_observer_count());
// Add calls should never have increased since the initial subscription. // Add call should not have increased since the initial subscription.
EXPECT_EQ(1, test_sync_service()->add_observer_count()); EXPECT_EQ(1, test_sync_service()->add_observer_count());
EXPECT_EQ(1, test_sync_service()->add_type_debug_info_observer_count());
} }
TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObserversDisallowJavascript) { TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObserversDisallowJavascript) {
...@@ -241,22 +217,14 @@ TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObserversDisallowJavascript) { ...@@ -241,22 +217,14 @@ TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObserversDisallowJavascript) {
handler()->HandleRegisterForEvents(&empty_list); handler()->HandleRegisterForEvents(&empty_list);
EXPECT_EQ(1, test_sync_service()->add_observer_count()); EXPECT_EQ(1, test_sync_service()->add_observer_count());
EXPECT_EQ(0, test_sync_service()->add_type_debug_info_observer_count());
handler()->HandleRegisterForPerTypeCounters(&empty_list);
EXPECT_EQ(1, test_sync_service()->add_type_debug_info_observer_count());
EXPECT_EQ(0, test_sync_service()->remove_observer_count()); EXPECT_EQ(0, test_sync_service()->remove_observer_count());
EXPECT_EQ(0, test_sync_service()->remove_type_debug_info_observer_count());
handler()->DisallowJavascript(); handler()->DisallowJavascript();
EXPECT_EQ(1, test_sync_service()->remove_observer_count()); EXPECT_EQ(1, test_sync_service()->remove_observer_count());
EXPECT_EQ(1, test_sync_service()->remove_type_debug_info_observer_count());
// Deregistration should not repeat, no counts should increase. // Deregistration should not repeat, no counts should increase.
ResetHandler(); ResetHandler();
EXPECT_EQ(1, test_sync_service()->add_observer_count()); EXPECT_EQ(1, test_sync_service()->add_observer_count());
EXPECT_EQ(1, test_sync_service()->add_type_debug_info_observer_count());
EXPECT_EQ(1, test_sync_service()->remove_observer_count()); EXPECT_EQ(1, test_sync_service()->remove_observer_count());
EXPECT_EQ(1, test_sync_service()->remove_type_debug_info_observer_count());
} }
TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObserversSyncDisabled) { TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObserversSyncDisabled) {
...@@ -266,33 +234,12 @@ TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObserversSyncDisabled) { ...@@ -266,33 +234,12 @@ TEST_F(SyncInternalsMessageHandlerTest, AddRemoveObserversSyncDisabled) {
ListValue empty_list; ListValue empty_list;
handler()->HandleRegisterForEvents(&empty_list); handler()->HandleRegisterForEvents(&empty_list);
handler()->HandleRegisterForPerTypeCounters(&empty_list);
handler()->DisallowJavascript(); handler()->DisallowJavascript();
// Cannot verify observer methods on sync services were not called, because // Cannot verify observer methods on sync services were not called, because
// there is no sync service. Rather, we're just making sure the handler hasn't // there is no sync service. Rather, we're just making sure the handler hasn't
// performed any invalid operations when the sync service is missing. // performed any invalid operations when the sync service is missing.
} }
TEST_F(SyncInternalsMessageHandlerTest,
RepeatedHandleRegisterForPerTypeCounters) {
ListValue empty_list;
handler()->HandleRegisterForPerTypeCounters(&empty_list);
EXPECT_EQ(1, test_sync_service()->add_type_debug_info_observer_count());
EXPECT_EQ(0, test_sync_service()->remove_type_debug_info_observer_count());
handler()->HandleRegisterForPerTypeCounters(&empty_list);
EXPECT_EQ(2, test_sync_service()->add_type_debug_info_observer_count());
EXPECT_EQ(1, test_sync_service()->remove_type_debug_info_observer_count());
handler()->HandleRegisterForPerTypeCounters(&empty_list);
EXPECT_EQ(3, test_sync_service()->add_type_debug_info_observer_count());
EXPECT_EQ(2, test_sync_service()->remove_type_debug_info_observer_count());
ResetHandler();
EXPECT_EQ(3, test_sync_service()->add_type_debug_info_observer_count());
EXPECT_EQ(3, test_sync_service()->remove_type_debug_info_observer_count());
}
TEST_F(SyncInternalsMessageHandlerTest, HandleGetAllNodes) { TEST_F(SyncInternalsMessageHandlerTest, HandleGetAllNodes) {
ListValue args; ListValue args;
args.AppendInteger(0); args.AppendInteger(0);
......
...@@ -35,7 +35,6 @@ content::WebUIDataSource* CreateSyncInternalsHTMLSource() { ...@@ -35,7 +35,6 @@ content::WebUIDataSource* CreateSyncInternalsHTMLSource() {
IDR_SYNC_DRIVER_SYNC_INTERNALS_INDEX_JS}, IDR_SYNC_DRIVER_SYNC_INTERNALS_INDEX_JS},
{syncer::sync_ui_util::kChromeSyncJS, {syncer::sync_ui_util::kChromeSyncJS,
IDR_SYNC_DRIVER_SYNC_INTERNALS_CHROME_SYNC_JS}, IDR_SYNC_DRIVER_SYNC_INTERNALS_CHROME_SYNC_JS},
{syncer::sync_ui_util::kTypesJS, IDR_SYNC_DRIVER_SYNC_INTERNALS_TYPES_JS},
{syncer::sync_ui_util::kSyncLogJS, {syncer::sync_ui_util::kSyncLogJS,
IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_LOG_JS}, IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_LOG_JS},
{syncer::sync_ui_util::kSyncNodeBrowserJS, {syncer::sync_ui_util::kSyncNodeBrowserJS,
......
...@@ -45,7 +45,6 @@ const char kSyncIndexJS[] = "sync_index.js"; ...@@ -45,7 +45,6 @@ const char kSyncIndexJS[] = "sync_index.js";
const char kSyncLogJS[] = "sync_log.js"; const char kSyncLogJS[] = "sync_log.js";
const char kSyncNodeBrowserJS[] = "sync_node_browser.js"; const char kSyncNodeBrowserJS[] = "sync_node_browser.js";
const char kSyncSearchJS[] = "sync_search.js"; const char kSyncSearchJS[] = "sync_search.js";
const char kTypesJS[] = "types.js";
const char kUserEventsJS[] = "user_events.js"; const char kUserEventsJS[] = "user_events.js";
const char kTrafficLogJS[] = "traffic_log.js"; const char kTrafficLogJS[] = "traffic_log.js";
...@@ -54,7 +53,6 @@ const char kDispatchEvent[] = "chrome.sync.dispatchEvent"; ...@@ -54,7 +53,6 @@ const char kDispatchEvent[] = "chrome.sync.dispatchEvent";
const char kGetAllNodes[] = "getAllNodes"; const char kGetAllNodes[] = "getAllNodes";
const char kGetAllNodesCallback[] = "chrome.sync.getAllNodesCallback"; const char kGetAllNodesCallback[] = "chrome.sync.getAllNodesCallback";
const char kRegisterForEvents[] = "registerForEvents"; const char kRegisterForEvents[] = "registerForEvents";
const char kRegisterForPerTypeCounters[] = "registerForPerTypeCounters";
const char kRequestIncludeSpecificsInitialState[] = const char kRequestIncludeSpecificsInitialState[] =
"requestIncludeSpecificsInitialState"; "requestIncludeSpecificsInitialState";
const char kRequestListOfTypes[] = "requestListOfTypes"; const char kRequestListOfTypes[] = "requestListOfTypes";
...@@ -70,20 +68,13 @@ const char kUserEventsVisibilityCallback[] = ...@@ -70,20 +68,13 @@ const char kUserEventsVisibilityCallback[] =
const char kWriteUserEvent[] = "writeUserEvent"; const char kWriteUserEvent[] = "writeUserEvent";
// Other strings. // Other strings.
const char kCommit[] = "commit";
const char kCounters[] = "counters";
const char kCounterType[] = "counterType";
const char kIncludeSpecifics[] = "includeSpecifics"; const char kIncludeSpecifics[] = "includeSpecifics";
const char kModelType[] = "modelType";
const char kOnAboutInfoUpdated[] = "onAboutInfoUpdated"; const char kOnAboutInfoUpdated[] = "onAboutInfoUpdated";
const char kOnCountersUpdated[] = "onCountersUpdated";
const char kOnProtocolEvent[] = "onProtocolEvent"; const char kOnProtocolEvent[] = "onProtocolEvent";
const char kOnReceivedIncludeSpecificsInitialState[] = const char kOnReceivedIncludeSpecificsInitialState[] =
"onReceivedIncludeSpecificsInitialState"; "onReceivedIncludeSpecificsInitialState";
const char kOnReceivedListOfTypes[] = "onReceivedListOfTypes"; const char kOnReceivedListOfTypes[] = "onReceivedListOfTypes";
const char kStatus[] = "status";
const char kTypes[] = "types"; const char kTypes[] = "types";
const char kUpdate[] = "update";
namespace { namespace {
......
...@@ -36,7 +36,6 @@ extern const char kSyncIndexJS[]; ...@@ -36,7 +36,6 @@ extern const char kSyncIndexJS[];
extern const char kSyncLogJS[]; extern const char kSyncLogJS[];
extern const char kSyncNodeBrowserJS[]; extern const char kSyncNodeBrowserJS[];
extern const char kSyncSearchJS[]; extern const char kSyncSearchJS[];
extern const char kTypesJS[];
extern const char kUserEventsJS[]; extern const char kUserEventsJS[];
extern const char kTrafficLogJS[]; extern const char kTrafficLogJS[];
...@@ -46,7 +45,6 @@ extern const char kDispatchEvent[]; ...@@ -46,7 +45,6 @@ extern const char kDispatchEvent[];
extern const char kGetAllNodes[]; extern const char kGetAllNodes[];
extern const char kGetAllNodesCallback[]; extern const char kGetAllNodesCallback[];
extern const char kRegisterForEvents[]; extern const char kRegisterForEvents[];
extern const char kRegisterForPerTypeCounters[];
extern const char kRequestIncludeSpecificsInitialState[]; extern const char kRequestIncludeSpecificsInitialState[];
extern const char kRequestListOfTypes[]; extern const char kRequestListOfTypes[];
extern const char kRequestStart[]; extern const char kRequestStart[];
...@@ -61,20 +59,12 @@ extern const char kWriteUserEvent[]; ...@@ -61,20 +59,12 @@ extern const char kWriteUserEvent[];
// Other strings. // Other strings.
// Must match the constants used in the resource files. // Must match the constants used in the resource files.
extern const char kCommit[];
extern const char kCounters[];
extern const char kCounterType[];
extern const char kIncludeSpecifics[]; extern const char kIncludeSpecifics[];
extern const char kModelType[];
extern const char kOnAboutInfoUpdated[]; extern const char kOnAboutInfoUpdated[];
extern const char kOnCountersUpdated[];
extern const char kOnProtocolEvent[]; extern const char kOnProtocolEvent[];
extern const char kOnReceivedIncludeSpecificsInitialState[]; extern const char kOnReceivedIncludeSpecificsInitialState[];
extern const char kOnReceivedListOfTypes[]; extern const char kOnReceivedListOfTypes[];
extern const char kStatus[];
extern const char kTypes[]; extern const char kTypes[];
extern const char kUpdate[];
// This function returns a DictionaryValue which contains all the information // This function returns a DictionaryValue which contains all the information
// required to populate the 'About' tab of about:sync. // required to populate the 'About' tab of about:sync.
// Note that |service| may be null. // Note that |service| may be null.
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
<include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_INDEX_HTML" file="resources/index.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_INDEX_HTML" file="resources/index.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_INDEX_JS" file="resources/sync_index.js" type="BINDATA" /> <include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_INDEX_JS" file="resources/sync_index.js" type="BINDATA" />
<include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_CHROME_SYNC_JS" file="resources/chrome_sync.js" type="BINDATA" /> <include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_CHROME_SYNC_JS" file="resources/chrome_sync.js" type="BINDATA" />
<include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_TYPES_JS" file="resources/types.js" type="BINDATA" />
<include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_LOG_JS" file="resources/sync_log.js" type="BINDATA" /> <include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_LOG_JS" file="resources/sync_log.js" type="BINDATA" />
<include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_NODE_BROWSER_JS" file="resources/sync_node_browser.js" type="BINDATA" /> <include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_NODE_BROWSER_JS" file="resources/sync_node_browser.js" type="BINDATA" />
<include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_SEARCH_JS" file="resources/sync_search.js" type="BINDATA" /> <include name="IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_SEARCH_JS" file="resources/sync_search.js" type="BINDATA" />
......
...@@ -20,8 +20,6 @@ js_type_check("closure_compile") { ...@@ -20,8 +20,6 @@ js_type_check("closure_compile") {
#":sync_node_browser", #":sync_node_browser",
#":sync_search", #":sync_search",
":traffic_log", ":traffic_log",
#":types",
":user_events", ":user_events",
] ]
} }
...@@ -90,10 +88,6 @@ js_library("traffic_log") { ...@@ -90,10 +88,6 @@ js_library("traffic_log") {
deps = [ "//ui/webui/resources/js:cr" ] deps = [ "//ui/webui/resources/js:cr" ]
} }
js_library("types") {
deps = [ "//ui/webui/resources/js:cr" ]
}
js_library("user_events") { js_library("user_events") {
deps = [ deps = [
"//ui/webui/resources/js:cr", "//ui/webui/resources/js:cr",
......
...@@ -32,29 +32,6 @@ cr.define('chrome.sync.about_tab', function() { ...@@ -32,29 +32,6 @@ cr.define('chrome.sync.about_tab', function() {
refreshAboutInfo(e.details); refreshAboutInfo(e.details);
} }
function onAboutInfoCountersUpdated(e) {
const details = e.details;
const modelType = details.modelType;
const counters = details.counters;
const typeStatusArray = chrome.sync.aboutInfo.type_status;
typeStatusArray.forEach(function(row) {
if (row.name === modelType) {
// There are three types of counters, only "status" counters have these
// fields. Keep the old values if updated fields are not present.
if (counters.numEntriesAndTombstones !== undefined) {
row.num_entries = counters.numEntriesAndTombstones;
}
if (counters.numEntries !== undefined) {
row.num_live = counters.numEntries;
}
}
});
jstProcess(
new JsEvalContext({type_status: typeStatusArray}), $('typeInfo'));
}
/** /**
* Helper to determine if an element is scrolled to its bottom limit. * Helper to determine if an element is scrolled to its bottom limit.
* @param {Element} elem element to check * @param {Element} elem element to check
...@@ -177,10 +154,6 @@ cr.define('chrome.sync.about_tab', function() { ...@@ -177,10 +154,6 @@ cr.define('chrome.sync.about_tab', function() {
'onAboutInfoUpdated', 'onAboutInfoUpdated',
onAboutInfoUpdatedEvent); onAboutInfoUpdatedEvent);
chrome.sync.events.removeEventListener(
'onCountersUpdated',
onAboutInfoCountersUpdated);
const aboutInfo = JSON.parse(data); const aboutInfo = JSON.parse(data);
refreshAboutInfo(aboutInfo); refreshAboutInfo(aboutInfo);
}); });
...@@ -219,10 +192,6 @@ cr.define('chrome.sync.about_tab', function() { ...@@ -219,10 +192,6 @@ cr.define('chrome.sync.about_tab', function() {
'onAboutInfoUpdated', 'onAboutInfoUpdated',
onAboutInfoUpdatedEvent); onAboutInfoUpdatedEvent);
chrome.sync.events.addEventListener(
'onCountersUpdated',
onAboutInfoCountersUpdated);
$('request-start').addEventListener('click', function(event) { $('request-start').addEventListener('click', function(event) {
chrome.sync.requestStart(); chrome.sync.requestStart();
}); });
......
...@@ -49,14 +49,6 @@ cr.define('chrome.sync', function() { ...@@ -49,14 +49,6 @@ cr.define('chrome.sync', function() {
chrome.send('registerForEvents'); chrome.send('registerForEvents');
} }
/**
* Registers to receive a stream of status counter update events
* chrome.sync.dispatchEvent().
*/
function registerForPerTypeCounters() {
chrome.send('registerForPerTypeCounters');
}
/** /**
* Asks the browser to refresh our snapshot of sync state. Should result * Asks the browser to refresh our snapshot of sync state. Should result
* in an onAboutInfoUpdated event being emitted. * in an onAboutInfoUpdated event being emitted.
...@@ -185,7 +177,6 @@ cr.define('chrome.sync', function() { ...@@ -185,7 +177,6 @@ cr.define('chrome.sync', function() {
getAllNodes: getAllNodes, getAllNodes: getAllNodes,
getAllNodesCallback: getAllNodesCallback, getAllNodesCallback: getAllNodesCallback,
registerForEvents: registerForEvents, registerForEvents: registerForEvents,
registerForPerTypeCounters: registerForPerTypeCounters,
requestUpdatedAboutInfo: requestUpdatedAboutInfo, requestUpdatedAboutInfo: requestUpdatedAboutInfo,
requestIncludeSpecificsInitialState: requestIncludeSpecificsInitialState, requestIncludeSpecificsInitialState: requestIncludeSpecificsInitialState,
requestListOfTypes: requestListOfTypes, requestListOfTypes: requestListOfTypes,
......
...@@ -11,7 +11,6 @@ chrome/test/functional/special_tabs.py. --> ...@@ -11,7 +11,6 @@ chrome/test/functional/special_tabs.py. -->
<link rel="stylesheet" href="chrome://resources/css/tree.css"> <link rel="stylesheet" href="chrome://resources/css/tree.css">
<link rel="stylesheet" href="about.css"> <link rel="stylesheet" href="about.css">
<link rel="stylesheet" href="events.css"> <link rel="stylesheet" href="events.css">
<link rel="stylesheet" href="types.css">
<link rel="stylesheet" href="sync_search.css"> <link rel="stylesheet" href="sync_search.css">
<link rel="stylesheet" href="sync_node_browser.css"> <link rel="stylesheet" href="sync_node_browser.css">
<link rel="stylesheet" href="traffic_log.css"> <link rel="stylesheet" href="traffic_log.css">
...@@ -41,7 +40,6 @@ chrome/test/functional/special_tabs.py. --> ...@@ -41,7 +40,6 @@ chrome/test/functional/special_tabs.py. -->
<script src="chrome_sync.js"></script> <script src="chrome_sync.js"></script>
<script src="about.js"></script> <script src="about.js"></script>
<script src="events.js"></script> <script src="events.js"></script>
<script src="types.js"></script>
<script src="sync_log.js"></script> <script src="sync_log.js"></script>
<script src="sync_node_browser.js"></script> <script src="sync_node_browser.js"></script>
<script src="sync_search.js"></script> <script src="sync_search.js"></script>
...@@ -66,7 +64,6 @@ chrome/test/functional/special_tabs.py. --> ...@@ -66,7 +64,6 @@ chrome/test/functional/special_tabs.py. -->
<tabbox id="sync-page"> <tabbox id="sync-page">
<tabs> <tabs>
<tab id="sync-about-tab">About</tab> <tab id="sync-about-tab">About</tab>
<tab id="sync-types-tab">Types</tab>
<tab id="sync-data-tab">Data</tab> <tab id="sync-data-tab">Data</tab>
<tab id="sync-events-tab">Events</tab> <tab id="sync-events-tab">Events</tab>
<tab id="sync-browser-tab">Sync Node Browser</tab> <tab id="sync-browser-tab">Sync Node Browser</tab>
...@@ -78,9 +75,6 @@ chrome/test/functional/special_tabs.py. --> ...@@ -78,9 +75,6 @@ chrome/test/functional/special_tabs.py. -->
<tabpanel> <tabpanel>
<include src="about.html"> <include src="about.html">
</tabpanel> </tabpanel>
<tabpanel>
<include src="types.html">
</tabpanel>
<tabpanel> <tabpanel>
<include src="data.html"> <include src="data.html">
</tabpanel> </tabpanel>
......
/* Copyright 2014 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#type-counters-table {
table-layout: fixed;
}
#type-counters-table th {
max-width: 80px;
width: 80px;
}
#type-counters-table th.type {
max-width: 200px;
width: 200px;
}
#type-counters-table tr:nth-child(odd) {
background: rgb(239, 243, 255);
}
<div id="type-counters-container-wrapper" jsskip="true">
<div class="section">
<h2>Type Counters</h2>
<table id="type-counters-table">
<thead>
<tr>
<th class='type' rowspan="2">Type</th>
<th rowspan="2">Total Entries</th>
<th colspan="8">Updates</th>
<th colspan="7">Commits</th>
</tr>
<tr>
<th>Updates Received</th>
<th>Reflected Updates Received</th>
<th>Tombstone Updates Received</th>
<th>Updates Applied</th>
<th>Hierarchy Conflict Application Failures</th>
<th>Encryption Conflict Application Failures</th>
<th>Server Overwrite Conflicts</th>
<th>Local Overwrite Conflicts</th>
<th>Creation Commit Attempts</th>
<th>Deletion Commit Attempts</th>
<th>Update Commit Attempts</th>
<th>All Commit Attempts</th>
<th>Commit Successes</th>
<th>Commit Conflicts</th>
<th>Commit Errors</th>
</tr>
</thead>
<tbody>
<tr jsselect="rows">
<td jscontent="type"></td>
<td jscontent="counters.numEntries || 0">0</td>
<td jscontent="counters.numUpdatesReceived || 0">0</td>
<td jscontent="counters.numReflectedUpdatesReceived || 0">0</td>
<td jscontent="counters.numTombstoneUpdatesReceived || 0">0</td>
<td jscontent="counters.numUpdatesApplied || 0">0</td>
<td jscontent="counters.numHierarchyConflictApplicationFailures || 0">0</td>
<td jscontent="counters.numEncryptionConflictApplicationFailures || 0">0</td>
<td jscontent="counters.numServerOverwrites || 0">0</td>
<td jscontent="counters.numLocalOverwrites || 0">0</td>
<td jscontent="counters.numCreationCommitsAttempted || 0">0</td>
<td jscontent="counters.numDeletionCommitsAttempted || 0">0</td>
<td jscontent="counters.numUpdateCommitsAttempted || 0">0</td>
<td jscontent="counters.numCommitsAttempted || 0">0</td>
<td jscontent="counters.numCommitsSuccess || 0">0</td>
<td jscontent="counters.numCommitsConflict || 0">0</td>
<td jscontent="counters.numCommitsError || 0">0</td>
</tr>
</tbody>
</table>
</div>
</div>
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
cr.define('chrome.sync.types', function() {
const typeCountersMap = {};
/**
* Redraws the counters table taking advantage of the most recent
* available information.
*
* Makes use of typeCountersMap, which is defined in the containing scope.
*/
function refreshTypeCountersDisplay() {
const typeCountersArray = [];
// Transform our map into an array to make jstemplate happy.
Object.keys(typeCountersMap).sort().forEach(function(t) {
typeCountersArray.push({
type: t,
counters: typeCountersMap[t],
});
});
jstProcess(
new JsEvalContext({ rows: typeCountersArray }),
$('type-counters-table'));
}
/**
* Helps to initialize the table by picking up where initTypeCounters() left
* off. That function registers this listener and requests that this event
* be emitted.
*
* @param {!Object} e An event containing the list of known sync types.
*/
function onReceivedListOfTypes(e) {
const types = e.details.types;
types.map(function(type) {
if (!typeCountersMap.hasOwnProperty(type)) {
typeCountersMap[type] = {};
}
});
chrome.sync.events.removeEventListener(
'onReceivedListOfTypes',
onReceivedListOfTypes);
refreshTypeCountersDisplay();
}
/**
* Callback for receipt of updated per-type counters.
*
* @param {!Object} e An event containing an updated counter.
*/
function onCountersUpdated(e) {
const details = e.details;
const modelType = details.modelType;
const counters = details.counters;
if (typeCountersMap.hasOwnProperty(modelType)) {
for (const k in counters) {
typeCountersMap[modelType][k] = counters[k];
}
}
refreshTypeCountersDisplay();
}
/**
* Initializes state and callbacks for the per-type counters and status UI.
*/
function initTypeCounters() {
chrome.sync.events.addEventListener(
'onCountersUpdated',
onCountersUpdated);
chrome.sync.events.addEventListener(
'onReceivedListOfTypes',
onReceivedListOfTypes);
chrome.sync.requestListOfTypes();
chrome.sync.registerForPerTypeCounters();
}
function onLoad() {
initTypeCounters();
}
return {
onLoad: onLoad
};
});
document.addEventListener('DOMContentLoaded', chrome.sync.types.onLoad, false);
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/values.h" #include "base/values.h"
#include "components/sync/driver/sync_service_observer.h" #include "components/sync/driver/sync_service_observer.h"
#include "components/sync/engine/cycle/type_debug_info_observer.h"
#include "components/sync/engine/events/protocol_event_observer.h" #include "components/sync/engine/events/protocol_event_observer.h"
#include "components/sync/js/js_controller.h" #include "components/sync/js/js_controller.h"
#include "components/sync/js/js_event_handler.h" #include "components/sync/js/js_event_handler.h"
...@@ -26,8 +25,7 @@ class SyncService; ...@@ -26,8 +25,7 @@ class SyncService;
class SyncInternalsMessageHandler : public web::WebUIIOSMessageHandler, class SyncInternalsMessageHandler : public web::WebUIIOSMessageHandler,
public syncer::JsEventHandler, public syncer::JsEventHandler,
public syncer::SyncServiceObserver, public syncer::SyncServiceObserver,
public syncer::ProtocolEventObserver, public syncer::ProtocolEventObserver {
public syncer::TypeDebugInfoObserver {
public: public:
SyncInternalsMessageHandler(); SyncInternalsMessageHandler();
~SyncInternalsMessageHandler() override; ~SyncInternalsMessageHandler() override;
...@@ -37,9 +35,6 @@ class SyncInternalsMessageHandler : public web::WebUIIOSMessageHandler, ...@@ -37,9 +35,6 @@ class SyncInternalsMessageHandler : public web::WebUIIOSMessageHandler,
// Sets up observers to receive events and forward them to the UI. // Sets up observers to receive events and forward them to the UI.
void HandleRegisterForEvents(const base::ListValue* args); void HandleRegisterForEvents(const base::ListValue* args);
// Sets up observers to receive per-type counters and forward them to the UI.
void HandleRegisterForPerTypeCounters(const base::ListValue* args);
// Fires an event to send updated info back to the page. // Fires an event to send updated info back to the page.
void HandleRequestUpdatedAboutInfo(const base::ListValue* args); void HandleRequestUpdatedAboutInfo(const base::ListValue* args);
...@@ -82,23 +77,6 @@ class SyncInternalsMessageHandler : public web::WebUIIOSMessageHandler, ...@@ -82,23 +77,6 @@ class SyncInternalsMessageHandler : public web::WebUIIOSMessageHandler,
// ProtocolEventObserver implementation. // ProtocolEventObserver implementation.
void OnProtocolEvent(const syncer::ProtocolEvent& e) override; void OnProtocolEvent(const syncer::ProtocolEvent& e) override;
// TypeDebugInfoObserver implementation.
void OnCommitCountersUpdated(syncer::ModelType type,
const syncer::CommitCounters& counters) override;
void OnUpdateCountersUpdated(syncer::ModelType type,
const syncer::UpdateCounters& counters) override;
void OnStatusCountersUpdated(syncer::ModelType type,
const syncer::StatusCounters& counters) override;
// Helper to emit counter updates.
//
// Used in implementation of On*CounterUpdated methods. Emits the given
// dictionary value with additional data to specify the model type and
// counter type.
void EmitCounterUpdate(syncer::ModelType type,
const std::string& counter_type,
std::unique_ptr<base::DictionaryValue> value);
private: private:
// Fetches updated aboutInfo and sends it to the page in the form of an // Fetches updated aboutInfo and sends it to the page in the form of an
// onAboutInfoUpdated event. // onAboutInfoUpdated event.
...@@ -113,10 +91,6 @@ class SyncInternalsMessageHandler : public web::WebUIIOSMessageHandler, ...@@ -113,10 +91,6 @@ class SyncInternalsMessageHandler : public web::WebUIIOSMessageHandler,
// A flag used to prevent double-registration with ProfileSyncService. // A flag used to prevent double-registration with ProfileSyncService.
bool is_registered_ = false; bool is_registered_ = false;
// A flag used to prevent double-registration as TypeDebugInfoObserver with
// ProfileSyncService.
bool is_registered_for_counters_ = false;
// Whether specifics should be included when converting protocol events to a // Whether specifics should be included when converting protocol events to a
// human readable format. // human readable format.
bool include_specifics_ = false; bool include_specifics_ = false;
......
...@@ -16,9 +16,6 @@ ...@@ -16,9 +16,6 @@
#include "components/sync/driver/sync_driver_switches.h" #include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h" #include "components/sync/driver/sync_user_settings.h"
#include "components/sync/engine/cycle/commit_counters.h"
#include "components/sync/engine/cycle/status_counters.h"
#include "components/sync/engine/cycle/update_counters.h"
#include "components/sync/engine/events/protocol_event.h" #include "components/sync/engine/events/protocol_event.h"
#include "components/sync/js/js_event_details.h" #include "components/sync/js/js_event_details.h"
#include "ios/components/webui/web_ui_provider.h" #include "ios/components/webui/web_ui_provider.h"
...@@ -54,10 +51,6 @@ SyncInternalsMessageHandler::~SyncInternalsMessageHandler() { ...@@ -54,10 +51,6 @@ SyncInternalsMessageHandler::~SyncInternalsMessageHandler() {
service->RemoveObserver(this); service->RemoveObserver(this);
service->RemoveProtocolEventObserver(this); service->RemoveProtocolEventObserver(this);
} }
if (service && is_registered_for_counters_) {
service->RemoveTypeDebugInfoObserver(this);
}
} }
void SyncInternalsMessageHandler::RegisterMessages() { void SyncInternalsMessageHandler::RegisterMessages() {
...@@ -68,12 +61,6 @@ void SyncInternalsMessageHandler::RegisterMessages() { ...@@ -68,12 +61,6 @@ void SyncInternalsMessageHandler::RegisterMessages() {
base::BindRepeating(&SyncInternalsMessageHandler::HandleRegisterForEvents, base::BindRepeating(&SyncInternalsMessageHandler::HandleRegisterForEvents,
base::Unretained(this))); base::Unretained(this)));
web_ui()->RegisterMessageCallback(
syncer::sync_ui_util::kRegisterForPerTypeCounters,
base::BindRepeating(
&SyncInternalsMessageHandler::HandleRegisterForPerTypeCounters,
base::Unretained(this)));
web_ui()->RegisterMessageCallback( web_ui()->RegisterMessageCallback(
syncer::sync_ui_util::kRequestUpdatedAboutInfo, syncer::sync_ui_util::kRequestUpdatedAboutInfo,
base::BindRepeating( base::BindRepeating(
...@@ -143,22 +130,6 @@ void SyncInternalsMessageHandler::HandleRegisterForEvents( ...@@ -143,22 +130,6 @@ void SyncInternalsMessageHandler::HandleRegisterForEvents(
} }
} }
void SyncInternalsMessageHandler::HandleRegisterForPerTypeCounters(
const base::ListValue* args) {
DCHECK(args->empty());
if (syncer::SyncService* service = GetSyncService()) {
if (!is_registered_for_counters_) {
service->AddTypeDebugInfoObserver(this);
is_registered_for_counters_ = true;
} else {
// Re-register to ensure counters get re-emitted.
service->RemoveTypeDebugInfoObserver(this);
service->AddTypeDebugInfoObserver(this);
}
}
}
void SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo( void SyncInternalsMessageHandler::HandleRequestUpdatedAboutInfo(
const base::ListValue* args) { const base::ListValue* args) {
DCHECK(args->empty()); DCHECK(args->empty());
...@@ -287,35 +258,6 @@ void SyncInternalsMessageHandler::OnProtocolEvent( ...@@ -287,35 +258,6 @@ void SyncInternalsMessageHandler::OnProtocolEvent(
DispatchEvent(syncer::sync_ui_util::kOnProtocolEvent, *value); DispatchEvent(syncer::sync_ui_util::kOnProtocolEvent, *value);
} }
void SyncInternalsMessageHandler::OnCommitCountersUpdated(
syncer::ModelType type,
const syncer::CommitCounters& counters) {
EmitCounterUpdate(type, syncer::sync_ui_util::kCommit, counters.ToValue());
}
void SyncInternalsMessageHandler::OnUpdateCountersUpdated(
syncer::ModelType type,
const syncer::UpdateCounters& counters) {
EmitCounterUpdate(type, syncer::sync_ui_util::kUpdate, counters.ToValue());
}
void SyncInternalsMessageHandler::OnStatusCountersUpdated(
syncer::ModelType type,
const syncer::StatusCounters& counters) {
EmitCounterUpdate(type, syncer::sync_ui_util::kStatus, counters.ToValue());
}
void SyncInternalsMessageHandler::EmitCounterUpdate(
syncer::ModelType type,
const std::string& counter_type,
std::unique_ptr<base::DictionaryValue> value) {
std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue());
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, std::move(value));
DispatchEvent(syncer::sync_ui_util::kOnCountersUpdated, *details);
}
void SyncInternalsMessageHandler::HandleJsEvent( void SyncInternalsMessageHandler::HandleJsEvent(
const std::string& name, const std::string& name,
const syncer::JsEventDetails& details) { const syncer::JsEventDetails& details) {
......
...@@ -30,8 +30,6 @@ web::WebUIIOSDataSource* CreateSyncInternalsHTMLSource() { ...@@ -30,8 +30,6 @@ web::WebUIIOSDataSource* CreateSyncInternalsHTMLSource() {
IDR_SYNC_DRIVER_SYNC_INTERNALS_INDEX_JS); IDR_SYNC_DRIVER_SYNC_INTERNALS_INDEX_JS);
source->AddResourcePath(syncer::sync_ui_util::kChromeSyncJS, source->AddResourcePath(syncer::sync_ui_util::kChromeSyncJS,
IDR_SYNC_DRIVER_SYNC_INTERNALS_CHROME_SYNC_JS); IDR_SYNC_DRIVER_SYNC_INTERNALS_CHROME_SYNC_JS);
source->AddResourcePath(syncer::sync_ui_util::kTypesJS,
IDR_SYNC_DRIVER_SYNC_INTERNALS_TYPES_JS);
source->AddResourcePath(syncer::sync_ui_util::kSyncLogJS, source->AddResourcePath(syncer::sync_ui_util::kSyncLogJS,
IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_LOG_JS); IDR_SYNC_DRIVER_SYNC_INTERNALS_SYNC_LOG_JS);
source->AddResourcePath(syncer::sync_ui_util::kSyncNodeBrowserJS, source->AddResourcePath(syncer::sync_ui_util::kSyncNodeBrowserJS,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment