#include <string>
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/signin/signin_ui_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/extensions/extension_install_ui.h"
#include "chrome/browser/ui/extensions/extension_installed_bubble_model.h"
#include "chrome/browser/ui/extensions/extension_installed_waiter.h"
#include "chrome/browser/ui/signin/bubble_signin_promo_delegate.h"
#include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_button.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/branded_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "extensions/common/extension.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_header_macros.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/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/link.h"
#include "ui/views/layout/box_layout.h"
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ui/views/promos/bubble_signin_promo_view.h"
#endif
namespace {
const int kRightColumnWidth = …;
constexpr gfx::Size kMaxIconSize{ … };
views::Label* CreateLabel(const std::u16string& text) { … }
views::View* AnchorViewForBrowser(const ExtensionInstalledBubbleModel* model,
Browser* browser) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<views::View> CreateSigninPromoView(
Profile* profile,
BubbleSignInPromoDelegate* delegate) { … }
#endif
}
class ExtensionInstalledBubbleView : public BubbleSignInPromoDelegate,
public views::BubbleDialogDelegateView { … };
void ExtensionInstalledBubbleView::Show(
Browser* browser,
std::unique_ptr<ExtensionInstalledBubbleModel> model) { … }
ExtensionInstalledBubbleView::ExtensionInstalledBubbleView(
Browser* browser,
std::unique_ptr<ExtensionInstalledBubbleModel> model)
: … { … }
ExtensionInstalledBubbleView::~ExtensionInstalledBubbleView() = default;
void ExtensionInstalledBubbleView::UpdateAnchorView() { … }
void ExtensionInstalledBubbleView::Init() { … }
void ExtensionInstalledBubbleView::OnSignIn(const AccountInfo& account) { … }
void ExtensionInstalledBubbleView::LinkClicked() { … }
BEGIN_METADATA(…)
void ShowUiOnToolbarMenu(scoped_refptr<const extensions::Extension> extension,
Browser* browser,
const SkBitmap& icon) { … }
void ExtensionInstallUI::ShowBubble(
scoped_refptr<const extensions::Extension> extension,
Browser* browser,
const SkBitmap& icon) { … }