chromium/chrome/browser/ui/webui/identity_internals_ui.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "chrome/browser/ui/webui/identity_internals_ui.h"

#include <memory>
#include <set>
#include <string>

#include "base/functional/bind.h"
#include "base/i18n/time_formatting.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/identity/identity_api.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/identity_internals_resources.h"
#include "chrome/grit/identity_internals_resources_map.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_id.h"
#include "google_apis/gaia/gaia_auth_fetcher.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"

namespace {

// RevokeToken message parameter offsets.
const int kRevokeTokenExtensionOffset =;
const int kRevokeTokenTokenOffset =;

class IdentityInternalsTokenRevoker;

// Class acting as a controller of the chrome://identity-internals WebUI.
class IdentityInternalsUIMessageHandler : public content::WebUIMessageHandler {};

// Handles the revoking of an access token and helps performing the clean up
// after it is revoked by holding information about the access token and related
// extension ID.
class IdentityInternalsTokenRevoker : public GaiaAuthConsumer {};

IdentityInternalsUIMessageHandler::IdentityInternalsUIMessageHandler() {}

IdentityInternalsUIMessageHandler::~IdentityInternalsUIMessageHandler() {}

void IdentityInternalsUIMessageHandler::OnTokenRevokerDone(
    IdentityInternalsTokenRevoker* token_revoker,
    const std::string& callback_id) {}

const std::string IdentityInternalsUIMessageHandler::GetExtensionName(
    const extensions::IdentityTokenCache::AccessTokensKey& access_tokens_key) {}

base::Value::List IdentityInternalsUIMessageHandler::GetScopes(
    const extensions::IdentityTokenCacheValue& token_cache_value) {}

std::string IdentityInternalsUIMessageHandler::GetStatus(
    const extensions::IdentityTokenCacheValue& token_cache_value) {}

std::u16string IdentityInternalsUIMessageHandler::GetExpirationTime(
    const extensions::IdentityTokenCacheValue& token_cache_value) {}

base::Value::Dict IdentityInternalsUIMessageHandler::GetInfoForToken(
    const extensions::IdentityTokenCache::AccessTokensKey& access_tokens_key,
    const extensions::IdentityTokenCacheValue& token_cache_value) {}

void IdentityInternalsUIMessageHandler::GetInfoForAllTokens(
    const base::Value::List& args) {}

void IdentityInternalsUIMessageHandler::RegisterMessages() {}

void IdentityInternalsUIMessageHandler::RevokeToken(
    const base::Value::List& list) {}

IdentityInternalsTokenRevoker::IdentityInternalsTokenRevoker(
    const std::string& extension_id,
    const std::string& access_token,
    const std::string& callback_id,
    Profile* profile,
    IdentityInternalsUIMessageHandler* consumer)
    :{}

IdentityInternalsTokenRevoker::~IdentityInternalsTokenRevoker() {}

void IdentityInternalsTokenRevoker::OnOAuth2RevokeTokenCompleted(
    GaiaAuthConsumer::TokenRevocationStatus status) {}

}  // namespace

IdentityInternalsUI::IdentityInternalsUI(content::WebUI* web_ui)
  :{}

IdentityInternalsUI::~IdentityInternalsUI() {}