chromium/components/sync/service/sync_internals_util.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/sync/service/sync_internals_util.h"

#include <string>
#include <utility>
#include <vector>

#include "base/i18n/time_formatting.h"
#include "base/notreached.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "components/sync/base/time.h"
#include "components/sync/engine/cycle/sync_cycle_snapshot.h"
#include "components/sync/engine/sync_status.h"
#include "components/sync/engine/sync_string_conversions.h"
#include "components/sync/protocol/proto_enum_conversions.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_token_status.h"
#include "components/sync/service/sync_user_settings.h"
#include "components/sync/service/trusted_vault_synthetic_field_trial.h"
#include "components/version_info/version_info.h"
#include "url/gurl.h"

namespace syncer::sync_ui_util {

namespace {

const char kUninitialized[] =;

const char kUninitializedCSSClass[] =;
const char kBadStateCSSClass[] =;

// This class represents one field in chrome://sync-internals. It gets
// serialized into a dictionary with entries for 'stat_name', 'stat_value' and
// 'stat_status'.
class StatBase {};

template <typename T>
class Stat : public StatBase {};

// A section for display on chrome://sync-internals, consisting of a title and a
// list of fields.
class Section {};

class SectionList {};

std::string GetDisableReasonsString(
    SyncService::DisableReasonSet disable_reasons) {}

std::string GetTransportStateString(syncer::SyncService::TransportState state) {}

std::string GetUserActionableErrorString(
    SyncService::UserActionableError state) {}

// Returns a string describing the chrome version environment. Version format:
// <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel">
// If version information is unavailable, returns "invalid."
// TODO(zea): this approximately matches syncer::MakeUserAgentForSync in
// sync_util.h. Unify the two if possible.
std::string GetVersionString(const std::string& channel) {}

std::string GetTimeStr(base::Time time,
                       const std::string& default_msg = "n/a") {}

std::string GetTimeStrFromProto(int64_t proto_time,
                                const std::string& default_msg = "n/a") {}

// Analogous to GetTimeDebugString from components/sync/base/time.h. Consider
// moving it there if more places need this.
std::string GetTimeDeltaDebugString(base::TimeDelta t) {}

std::string GetLastSyncedTimeString(base::Time last_synced_time) {}

std::string GetConnectionStatus(const SyncTokenStatus& status) {}

}  // namespace

// This function both defines the structure of the message to be returned and
// its contents.  Most of the message consists of simple fields in
// chrome://sync-internals which are grouped into sections and populated with
// the help of the SyncStat classes defined above.
base::Value::Dict ConstructAboutInformation(
    IncludeSensitiveData include_sensitive_data,
    SyncService* service,
    const std::string& channel) {}

}  // namespace syncer::sync_ui_util