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

#include <cmath>
#include <memory>

#include "base/auto_reset.h"
#include "base/i18n/number_formatting.h"
#include "base/i18n/rtl.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/toolbar_button_provider.h"
#include "chrome/browser/ui/views/page_action/zoom_view.h"
#include "chrome/grit/generated_resources.h"
#include "components/zoom/page_zoom.h"
#include "components/zoom/zoom_controller.h"
#include "extensions/browser/extension_zoom_request_client.h"
#include "extensions/common/api/extension_action/action_info.h"
#include "extensions/common/manifest_handlers/icons_handler.h"
#include "extensions/grit/extensions_browser_resources.h"
#include "third_party/blink/public/common/page/page_zoom.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/models/image_model.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/text_utils.h"
#include "ui/gfx/vector_icon_types.h"
#include "ui/native_theme/native_theme.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/widget.h"

#if BUILDFLAG(IS_MAC)
#include "chrome/browser/ui/fullscreen_util_mac.h"
#endif

namespace {

// The default time that the bubble should stay on the screen if it will close
// automatically.
constexpr base::TimeDelta kBubbleCloseDelayDefault =;

// A longer timeout used for how long the bubble should stay on the screen
// before it will close automatically after + or - buttons have been used.
constexpr base::TimeDelta kBubbleCloseDelayLong =;

class ZoomButtonHighlightPathGenerator : public views::HighlightPathGenerator {};

std::unique_ptr<views::ImageButton> CreateZoomButton(
    views::Button::PressedCallback callback,
    const gfx::VectorIcon& icon,
    int tooltip_id) {}

class ZoomValue : public views::Label {};

BEGIN_METADATA()

bool IsBrowserFullscreen(Browser* browser) {}

views::View* GetAnchorViewForBrowser(Browser* browser) {}

ImmersiveModeController* GetImmersiveModeControllerForBrowser(
    Browser* browser) {}

void ParentToBrowser(Browser* browser,
                     ZoomBubbleView* zoom_bubble,
                     views::View* anchor_view,
                     content::WebContents* web_contents) {}

// Find the extension that initiated the zoom change, if any.
const extensions::ExtensionZoomRequestClient* GetExtensionZoomRequestClient(
    const content::WebContents* web_contents) {}

}  // namespace

// static
ZoomBubbleView* ZoomBubbleView::zoom_bubble_ =;

// static
void ZoomBubbleView::ShowBubble(content::WebContents* web_contents,
                                DisplayReason reason) {}

// static
bool ZoomBubbleView::RefreshBubbleIfShowing(
    const content::WebContents* web_contents) {}

// static
bool ZoomBubbleView::CanRefresh(const content::WebContents* web_contents) {}

// static
void ZoomBubbleView::CloseCurrentBubble() {}

// static
ZoomBubbleView* ZoomBubbleView::GetZoomBubble() {}

void ZoomBubbleView::Refresh() {}

ZoomBubbleView::ZoomBubbleView(
    views::View* anchor_view,
    content::WebContents* web_contents,
    DisplayReason reason,
    ImmersiveModeController* immersive_mode_controller)
    :{}

ZoomBubbleView::~ZoomBubbleView() {}

std::u16string ZoomBubbleView::GetAccessibleWindowTitle() const {}

void ZoomBubbleView::OnFocus() {}

void ZoomBubbleView::OnBlur() {}

void ZoomBubbleView::OnGestureEvent(ui::GestureEvent* event) {}

void ZoomBubbleView::OnKeyEvent(ui::KeyEvent* event) {}

void ZoomBubbleView::OnMouseEntered(const ui::MouseEvent& event) {}

void ZoomBubbleView::OnMouseExited(const ui::MouseEvent& event) {}

void ZoomBubbleView::Init() {}

void ZoomBubbleView::WindowClosing() {}

void ZoomBubbleView::CloseBubble() {}

void ZoomBubbleView::OnImmersiveRevealStarted() {}

void ZoomBubbleView::OnImmersiveModeControllerDestroyed() {}

void ZoomBubbleView::OnExtensionIconImageChanged(
    extensions::IconImage* /* image */) {}

void ZoomBubbleView::SetExtensionInfo(const extensions::Extension* extension) {}

void ZoomBubbleView::UpdateZoomPercent() {}

void ZoomBubbleView::UpdateZoomIconVisibility() {}

void ZoomBubbleView::StartTimerIfNecessary() {}

void ZoomBubbleView::StopTimer() {}

void ZoomBubbleView::ButtonPressed(base::RepeatingClosure closure) {}

void ZoomBubbleView::ImageButtonPressed() {}

Browser* ZoomBubbleView::GetBrowser() const {}

ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {}

ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {}

BEGIN_METADATA()