chromium/chrome/browser/extensions/external_install_error.cc

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

#include "chrome/browser/extensions/external_install_error.h"

#include <stddef.h>

#include <memory>
#include <utility>

#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/extensions/extension_install_error_menu_item_id_provider.h"
#include "chrome/browser/extensions/extension_install_prompt_show_params.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/external_install_manager.h"
#include "chrome/browser/extensions/webstore_data_fetcher.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/global_error/global_error.h"
#include "chrome/browser/ui/global_error/global_error_service.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/grit/generated_resources.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/storage_partition.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"

namespace extensions {

namespace {

// Return the menu label for a global error.
std::u16string GetMenuItemLabel(const Extension* extension) {}

// A global error that spawns a dialog when the menu item is clicked.
class ExternalInstallMenuAlert : public GlobalError {};

// A global error that spawns a bubble when the menu item is clicked.
class ExternalInstallBubbleAlert final : public GlobalErrorWithStandardBubble {};

////////////////////////////////////////////////////////////////////////////////
// ExternalInstallMenuAlert

ExternalInstallMenuAlert::ExternalInstallMenuAlert(ExternalInstallError* error)
    :{}

ExternalInstallMenuAlert::~ExternalInstallMenuAlert() {}

GlobalError::Severity ExternalInstallMenuAlert::GetSeverity() {}

bool ExternalInstallMenuAlert::HasMenuItem() {}

int ExternalInstallMenuAlert::MenuItemCommandID() {}

std::u16string ExternalInstallMenuAlert::MenuItemLabel() {}

void ExternalInstallMenuAlert::ExecuteMenuItem(Browser* browser) {}

bool ExternalInstallMenuAlert::HasBubbleView() {}

bool ExternalInstallMenuAlert::HasShownBubbleView() {}

void ExternalInstallMenuAlert::ShowBubbleView(Browser* browser) {}

GlobalErrorBubbleViewBase* ExternalInstallMenuAlert::GetBubbleView() {}

////////////////////////////////////////////////////////////////////////////////
// ExternalInstallBubbleAlert

ExternalInstallBubbleAlert::ExternalInstallBubbleAlert(
    ExternalInstallError* error,
    ExtensionInstallPrompt::Prompt* prompt)
    :{}

ExternalInstallBubbleAlert::~ExternalInstallBubbleAlert() {}

GlobalError::Severity ExternalInstallBubbleAlert::GetSeverity() {}

bool ExternalInstallBubbleAlert::HasMenuItem() {}

int ExternalInstallBubbleAlert::MenuItemCommandID() {}

std::u16string ExternalInstallBubbleAlert::MenuItemLabel() {}

void ExternalInstallBubbleAlert::ExecuteMenuItem(Browser* browser) {}

std::u16string ExternalInstallBubbleAlert::GetBubbleViewTitle() {}

std::vector<std::u16string>
ExternalInstallBubbleAlert::GetBubbleViewMessages() {}

std::u16string ExternalInstallBubbleAlert::GetBubbleViewAcceptButtonLabel() {}

std::u16string ExternalInstallBubbleAlert::GetBubbleViewCancelButtonLabel() {}

void ExternalInstallBubbleAlert::OnBubbleViewDidClose(Browser* browser) {}

void ExternalInstallBubbleAlert::BubbleViewAcceptButtonPressed(
    Browser* browser) {}

void ExternalInstallBubbleAlert::BubbleViewCancelButtonPressed(
    Browser* browser) {}

base::WeakPtr<GlobalErrorWithStandardBubble>
ExternalInstallBubbleAlert::AsWeakPtr() {}

}  // namespace

////////////////////////////////////////////////////////////////////////////////
// ExternalInstallError

ExternalInstallError::ExternalInstallError(
    content::BrowserContext* browser_context,
    const std::string& extension_id,
    AlertType alert_type,
    ExternalInstallManager* manager)
    :{}

ExternalInstallError::~ExternalInstallError() {}

void ExternalInstallError::OnInstallPromptDone(
    ExtensionInstallPrompt::DoneCallbackPayload payload) {}

void ExternalInstallError::DidOpenBubbleView() {}

void ExternalInstallError::DidCloseBubbleView() {}

void ExternalInstallError::ShowDialog(Browser* browser) {}

const Extension* ExternalInstallError::GetExtension() const {}

void ExternalInstallError::OnWebstoreRequestFailure(
    const std::string& extension_id) {}

void ExternalInstallError::OnWebstoreItemJSONAPIResponseParseSuccess(
    const std::string& extension_id,
    const base::Value::Dict& webstore_data) {}

void ExternalInstallError::OnFetchItemSnippetParseSuccess(
    const std::string& extension_id,
    FetchItemSnippetResponse item_snippet) {}

void ExternalInstallError::OnWebstoreResponseParseFailure(
    const std::string& extension_id,
    const std::string& error) {}

void ExternalInstallError::OnFetchComplete() {}

void ExternalInstallError::OnDialogReady(
    std::unique_ptr<ExtensionInstallPromptShowParams> show_params,
    ExtensionInstallPrompt::DoneCallback callback,
    std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt) {}

void ExternalInstallError::RemoveError() {}

}  // namespace extensions