#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/download/bubble/download_bubble_prefs.h"
#include "chrome/browser/ui/browser_command_controller.h"
#include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/view_ids.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/extensions/extensions_toolbar_coordinator.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/page_action_icon_controller.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_params.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/system_app_accessible_name.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.h"
#include "chrome/browser/ui/views/web_apps/frame_toolbar/window_controls_overlay_toggle_button.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/common/chrome_features.h"
#include "ui/base/hit_test.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/window/hit_test_utils.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ui/ash/system_web_apps/system_web_app_ui_utils.h"
#endif
#if BUILDFLAG(IS_MAC)
#include "chrome/browser/web_applications/os_integration/mac/app_shim_registry.h"
#endif
namespace {
bool g_animation_disabled_for_testing = …;
}
constexpr base::TimeDelta WebAppToolbarButtonContainer::kTitlebarAnimationDelay;
constexpr base::TimeDelta WebAppToolbarButtonContainer::kOriginFadeInDuration;
constexpr base::TimeDelta WebAppToolbarButtonContainer::kOriginPauseDuration;
constexpr base::TimeDelta WebAppToolbarButtonContainer::kOriginFadeOutDuration;
base::TimeDelta WebAppToolbarButtonContainer::OriginTotalDuration() { … }
WebAppToolbarButtonContainer::WebAppToolbarButtonContainer(
BrowserView* browser_view,
ToolbarButtonProvider* toolbar_button_provider)
: … { … }
WebAppToolbarButtonContainer::~WebAppToolbarButtonContainer() { … }
void WebAppToolbarButtonContainer::UpdateStatusIconsVisibility() { … }
void WebAppToolbarButtonContainer::SetColors(SkColor foreground_color,
SkColor background_color,
bool color_changed) { … }
views::FlexRule WebAppToolbarButtonContainer::GetFlexRule() const { … }
void WebAppToolbarButtonContainer::DisableAnimationForTesting(bool disable) { … }
void WebAppToolbarButtonContainer::AddPageActionIcon(
std::unique_ptr<views::View> icon) { … }
int WebAppToolbarButtonContainer::GetPageActionIconSize() const { … }
gfx::Insets WebAppToolbarButtonContainer::GetPageActionIconInsets(
const PageActionIconView* icon_view) const { … }
bool WebAppToolbarButtonContainer::GetAnimate() const { … }
void WebAppToolbarButtonContainer::StartTitlebarAnimation() { … }
void WebAppToolbarButtonContainer::FadeInContentSettingIcons() { … }
void WebAppToolbarButtonContainer::ChildPreferredSizeChanged(
views::View* child) { … }
SkColor
WebAppToolbarButtonContainer::GetIconLabelBubbleSurroundingForegroundColor()
const { … }
SkColor WebAppToolbarButtonContainer::GetIconLabelBubbleBackgroundColor()
const { … }
bool WebAppToolbarButtonContainer::ShouldHideContentSettingImage() { … }
content::WebContents*
WebAppToolbarButtonContainer::GetContentSettingWebContents() { … }
ContentSettingBubbleModelDelegate*
WebAppToolbarButtonContainer::GetContentSettingBubbleModelDelegate() { … }
void WebAppToolbarButtonContainer::OnImmersiveRevealStarted() { … }
content::WebContents*
WebAppToolbarButtonContainer::GetWebContentsForPageActionIconView() { … }
void WebAppToolbarButtonContainer::AddedToWidget() { … }
#if BUILDFLAG(IS_MAC)
void WebAppToolbarButtonContainer::AppShimChanged(
const webapps::AppId& changed_app_id) {
const auto* app_controller = browser_view_->browser()->app_controller();
if (changed_app_id != app_controller->app_id()) {
return;
}
if (avatar_button_) {
avatar_button_->SetVisible(app_controller->IsProfileMenuButtonVisible());
}
}
#endif
BEGIN_METADATA(…)