chromium/chrome/browser/ui/views/extensions/extension_popup.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 "chrome/browser/ui/views/extensions/extension_popup.h"

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/extensions/extension_view_host.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/views/extensions/extensions_dialogs_utils.h"
#include "chrome/browser/ui/views/extensions/security_dialog_tracker.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "components/javascript_dialogs/app_modal_dialog_queue.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/views/border.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/native/native_view_host.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/style/platform_style.h"
#include "ui/views/widget/widget.h"

#if defined(USE_AURA)
#include "ui/aura/window.h"
#include "ui/wm/core/window_animations.h"
#endif

#if BUILDFLAG(IS_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#endif

#if BUILDFLAG(IS_MAC)
#include "base/message_loop/message_pump_apple.h"
#endif

constexpr gfx::Size ExtensionPopup::kMinSize;
constexpr gfx::Size ExtensionPopup::kMaxSize;

// The most recently constructed popup; used for testing purposes.
ExtensionPopup* g_last_popup_for_testing =;

// A helper class to scope the observation of DevToolsAgentHosts. We can't just
// use base::ScopedObservation here because that requires a specific source
// object, where as DevToolsAgentHostObservers are added to a singleton list.
// The `observer_` passed into this object will be registered as an observer
// for this object's lifetime.
class ExtensionPopup::ScopedDevToolsAgentHostObservation {};

// static
ExtensionPopup* ExtensionPopup::last_popup_for_testing() {}

// static
void ExtensionPopup::ShowPopup(
    std::unique_ptr<extensions::ExtensionViewHost> host,
    views::View* anchor_view,
    views::BubbleBorder::Arrow arrow,
    PopupShowAction show_action,
    ShowPopupCallback callback) {}

ExtensionPopup::~ExtensionPopup() {}

gfx::Size ExtensionPopup::CalculatePreferredSize(
    const views::SizeBounds& available_size) const {}

void ExtensionPopup::AddedToWidget() {}

void ExtensionPopup::OnWidgetDestroying(views::Widget* widget) {}

void ExtensionPopup::OnWidgetTreeActivated(views::Widget* root_widget,
                                           views::Widget* active_widget) {}

gfx::Size ExtensionPopup::GetMinBounds() {}

gfx::Size ExtensionPopup::GetMaxBounds() {}

void ExtensionPopup::OnExtensionUnloaded(
    content::BrowserContext* browser_context,
    const extensions::Extension* extension,
    extensions::UnloadedExtensionReason reason) {}

void ExtensionPopup::DocumentOnLoadCompletedInPrimaryMainFrame() {}

void ExtensionPopup::OnTabStripModelChanged(
    TabStripModel* tab_strip_model,
    const TabStripModelChange& change,
    const TabStripSelectionChange& selection) {}

void ExtensionPopup::DevToolsAgentHostAttached(
    content::DevToolsAgentHost* agent_host) {}

void ExtensionPopup::DevToolsAgentHostDetached(
    content::DevToolsAgentHost* agent_host) {}

ExtensionPopup::ExtensionPopup(
    std::unique_ptr<extensions::ExtensionViewHost> host,
    views::View* anchor_view,
    views::BubbleBorder::Arrow arrow,
    PopupShowAction show_action,
    ShowPopupCallback callback)
    :{}

void ExtensionPopup::ShowBubble() {}

void ExtensionPopup::CloseUnlessBlockedByInspectionOrJSDialog() {}

void ExtensionPopup::CloseDeferredIfNecessary(
    views::Widget::ClosedReason reason) {}

void ExtensionPopup::HandleCloseExtensionHost(extensions::ExtensionHost* host) {}

BEGIN_METADATA()