#include "chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.h"
#include "base/base64.h"
#include "base/containers/span.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/ui/actions/chrome_action_id.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_actions.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_controller.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/chrome_typography.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/top_container_view.h"
#include "chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_util.h"
#include "chrome/grit/generated_resources.h"
#include "components/qr_code_generator/bitmap_generator.h"
#include "components/sharing_message/features.h"
#include "components/url_formatter/url_formatter.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/web_contents.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "ui/base/clipboard/scoped_clipboard_writer.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/base/theme_provider.h"
#include "ui/base/webui/web_ui_util.h"
#include "ui/events/event.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/image/image_skia_source.h"
#include "ui/native_theme/native_theme.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/border.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/bubble/tooltip_icon.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
namespace {
constexpr int kPaddingTooltipDownloadButtonPx = …;
constexpr gfx::Size GetQRCodeImageSize() { … }
gfx::ImageSkia CreateBackgroundImageSkia(const gfx::Size& size, SkColor color) { … }
}
namespace qrcode_generator {
QRCodeGeneratorBubble::QRCodeGeneratorBubble(
views::View* anchor_view,
base::WeakPtr<content::WebContents> web_contents,
base::OnceClosure on_closing,
base::OnceClosure on_back_button_pressed,
const GURL& url)
: … { … }
QRCodeGeneratorBubble::~QRCodeGeneratorBubble() { … }
void QRCodeGeneratorBubble::Show() { … }
void QRCodeGeneratorBubble::Hide() { … }
void QRCodeGeneratorBubble::OnThemeChanged() { … }
void QRCodeGeneratorBubble::UpdateQRContent() { … }
void QRCodeGeneratorBubble::UpdateQRImage(gfx::ImageSkia qr_image) { … }
void QRCodeGeneratorBubble::DisplayPlaceholderImage() { … }
void QRCodeGeneratorBubble::DisplayError(qr_code_generator::Error error) { … }
void QRCodeGeneratorBubble::HideErrors(bool enable_button) { … }
void QRCodeGeneratorBubble::ShrinkAndHideDisplay(views::View* view) { … }
views::View* QRCodeGeneratorBubble::GetInitiallyFocusedView() { … }
bool QRCodeGeneratorBubble::ShouldShowCloseButton() const { … }
void QRCodeGeneratorBubble::WindowClosing() { … }
void QRCodeGeneratorBubble::Init() { … }
void QRCodeGeneratorBubble::AddedToWidget() { … }
void QRCodeGeneratorBubble::ContentsChanged(
views::Textfield* sender,
const std::u16string& new_contents) { … }
bool QRCodeGeneratorBubble::HandleKeyEvent(views::Textfield* sender,
const ui::KeyEvent& key_event) { … }
bool QRCodeGeneratorBubble::HandleMouseEvent(
views::Textfield* sender,
const ui::MouseEvent& mouse_event) { … }
const std::u16string QRCodeGeneratorBubble::GetQRCodeFilenameForURL(
const GURL& url) { … }
void QRCodeGeneratorBubble::SetQRCodeErrorForTesting(
std::optional<qr_code_generator::Error> error) { … }
const SkBitmap QRCodeGeneratorBubble::GetBitmap() { … }
void QRCodeGeneratorBubble::CopyButtonPressed() { … }
void QRCodeGeneratorBubble::DownloadButtonPressed() { … }
void QRCodeGeneratorBubble::BackButtonPressed() { … }
BEGIN_METADATA(…)
}