#include "chrome/browser/ui/views/extensions/extensions_menu_view.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/i18n/case_conversion.h"
#include "base/memory/ptr_util.h"
#include "base/not_fatal_until.h"
#include "base/ranges/algorithm.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/extensions/extension_action_view_controller.h"
#include "chrome/browser/ui/extensions/extensions_container.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "chrome/browser/ui/views/bubble_menu_item_factory.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/browser/ui/views/controls/hover_button.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_item_view.h"
#include "chrome/grit/generated_resources.h"
#include "components/vector_icons/vector_icons.h"
#include "extensions/common/extension_features.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/color/color_id.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/border.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/view_utils.h"
namespace {
bool g_allow_testing_dialogs = …;
ExtensionsMenuView* g_extensions_dialog = …;
constexpr int EXTENSIONS_SETTINGS_ID = …;
bool CompareExtensionMenuItemViews(const ExtensionMenuItemView* a,
const ExtensionMenuItemView* b) { … }
ExtensionMenuItemView* GetAsMenuItemView(views::View* view) { … }
}
ExtensionsMenuView::ExtensionsMenuView(
views::View* anchor_view,
Browser* browser,
ExtensionsContainer* extensions_container)
: … { … }
ExtensionsMenuView::~ExtensionsMenuView() { … }
void ExtensionsMenuView::Populate() { … }
std::unique_ptr<views::View>
ExtensionsMenuView::CreateExtensionButtonsContainer() { … }
ExtensionsMenuView::Section* ExtensionsMenuView::GetSectionForSiteInteraction(
extensions::SitePermissionsHelper::SiteInteraction site_interaction) { … }
void ExtensionsMenuView::SortMenuItemsByName() { … }
void ExtensionsMenuView::CreateAndInsertNewItem(
const ToolbarActionsModel::ActionId& id) { … }
void ExtensionsMenuView::InsertMenuItem(ExtensionMenuItemView* menu_item) { … }
void ExtensionsMenuView::UpdateSectionVisibility() { … }
void ExtensionsMenuView::Update() { … }
void ExtensionsMenuView::SanityCheck() { … }
std::u16string ExtensionsMenuView::GetAccessibleWindowTitle() const { … }
void ExtensionsMenuView::TabChangedAt(content::WebContents* contents,
int index,
TabChangeType change_type) { … }
void ExtensionsMenuView::OnTabStripModelChanged(
TabStripModel* tab_strip_model,
const TabStripModelChange& change,
const TabStripSelectionChange& selection) { … }
void ExtensionsMenuView::OnToolbarActionAdded(
const ToolbarActionsModel::ActionId& item) { … }
void ExtensionsMenuView::OnToolbarActionRemoved(
const ToolbarActionsModel::ActionId& action_id) { … }
void ExtensionsMenuView::OnToolbarActionUpdated(
const ToolbarActionsModel::ActionId& action_id) { … }
void ExtensionsMenuView::OnToolbarModelInitialized() { … }
void ExtensionsMenuView::OnToolbarPinnedActionsChanged() { … }
base::AutoReset<bool> ExtensionsMenuView::AllowInstancesForTesting() { … }
views::Widget* ExtensionsMenuView::ShowBubble(
views::View* anchor_view,
Browser* browser,
ExtensionsContainer* extensions_container) { … }
bool ExtensionsMenuView::IsShowing() { … }
void ExtensionsMenuView::Hide() { … }
ExtensionsMenuView* ExtensionsMenuView::GetExtensionsMenuViewForTesting() { … }
std::vector<ExtensionMenuItemView*>
ExtensionsMenuView::GetSortedItemsForSectionForTesting(
extensions::SitePermissionsHelper::SiteInteraction site_interaction) { … }
BEGIN_METADATA(…)