chromium/chrome/browser/extensions/api/proxy/proxy_api.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.

// Implementation of the Chrome Extensions Proxy Settings API.

#include "chrome/browser/extensions/api/proxy/proxy_api.h"

#include <memory>
#include <optional>
#include <utility>

#include "base/json/json_writer.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/proxy/proxy_api_constants.h"
#include "chrome/browser/extensions/api/proxy/proxy_api_helpers.h"
#include "chrome/browser/extensions/event_router_forwarder.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extensions_browser_client.h"
#include "net/base/net_errors.h"

namespace extensions {

namespace {

const char kProxyEventFatalKey[] =;
const char kProxyEventErrorKey[] =;
const char kProxyEventDetailsKey[] =;
const char kProxyEventOnProxyError[] =;

// Helper method to dispatch an event to a particular profile indicated by
// `profile_ptr`, but only if that profile is valid.
void DispatchEventToProfile(void* profile_ptr,
                            events::HistogramValue histogram_value,
                            const std::string& event_name,
                            base::Value::List event_args) {}

}  // anonymous namespace

// static
ProxyEventRouter* ProxyEventRouter::GetInstance() {}

ProxyEventRouter::ProxyEventRouter() {}

ProxyEventRouter::~ProxyEventRouter() {}

void ProxyEventRouter::OnProxyError(
    void* profile,
    int error_code) {}

void ProxyEventRouter::OnPACScriptError(void* profile,
                                        int line_number,
                                        const std::u16string& error) {}

ProxyPrefTransformer::ProxyPrefTransformer() = default;

ProxyPrefTransformer::~ProxyPrefTransformer() = default;

std::optional<base::Value> ProxyPrefTransformer::ExtensionToBrowserPref(
    const base::Value& extension_pref,
    std::string& error,
    bool& bad_message) {}

std::optional<base::Value> ProxyPrefTransformer::BrowserToExtensionPref(
    const base::Value& browser_pref,
    bool is_incognito_profile) {}

}  // namespace extensions