Commit 1acb35c3 authored by Caroline Rising's avatar Caroline Rising Committed by Commit Bot

Prevent the extensions container from existing in system web apps.


Bug: 1067783
Change-Id: I624d43ee3863272bb4d7bef347b157164e886d52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2145861Reviewed-by: default avatarcalamity <calamity@chromium.org>
Commit-Queue: Caroline Rising <corising@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758866}
parent 89910d75
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "chrome/browser/ui/views/web_apps/web_app_menu_button.h" #include "chrome/browser/ui/views/web_apps/web_app_menu_button.h"
#include "chrome/browser/ui/views/web_apps/web_app_origin_text.h" #include "chrome/browser/ui/views/web_apps/web_app_origin_text.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h" #include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/browser/ui/web_applications/system_web_app_ui_utils.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/common/features.h" #include "components/content_settings/core/common/features.h"
...@@ -646,9 +647,12 @@ WebAppFrameToolbarView::ToolbarButtonContainer::ToolbarButtonContainer( ...@@ -646,9 +647,12 @@ WebAppFrameToolbarView::ToolbarButtonContainer::ToolbarButtonContainer(
params.page_action_icon_delegate = this; params.page_action_icon_delegate = this;
page_action_icon_controller_->Init(params, this); page_action_icon_controller_->Init(params, this);
// Extensions toolbar area with pinned extensions is lower priority than, for // Do not create the extensions or browser actions container if it is a
// example, the menu button or other toolbar buttons, and pinned extensions // System Web App.
// should hide before other toolbar buttons. if (!web_app::IsSystemWebApp(browser_view_->browser())) {
// Extensions toolbar area with pinned extensions is lower priority than,
// for example, the menu button or other toolbar buttons, and pinned
// extensions should hide before other toolbar buttons.
constexpr int kLowPriorityFlexOrder = 2; constexpr int kLowPriorityFlexOrder = 2;
if (base::FeatureList::IsEnabled(features::kExtensionsToolbarMenu)) { if (base::FeatureList::IsEnabled(features::kExtensionsToolbarMenu)) {
extensions_container_ = extensions_container_ =
...@@ -666,7 +670,8 @@ WebAppFrameToolbarView::ToolbarButtonContainer::ToolbarButtonContainer( ...@@ -666,7 +670,8 @@ WebAppFrameToolbarView::ToolbarButtonContainer::ToolbarButtonContainer(
} else { } else {
browser_actions_container_ = browser_actions_container_ =
AddChildView(std::make_unique<BrowserActionsContainer>( AddChildView(std::make_unique<BrowserActionsContainer>(
browser_view_->browser(), nullptr, this, false /* interactive */)); browser_view_->browser(), nullptr, this,
false /* interactive */));
browser_actions_container_->SetProperty( browser_actions_container_->SetProperty(
views::kFlexBehaviorKey, views::kFlexBehaviorKey,
views::FlexSpecification(browser_actions_container_->GetFlexRule()) views::FlexSpecification(browser_actions_container_->GetFlexRule())
...@@ -674,6 +679,7 @@ WebAppFrameToolbarView::ToolbarButtonContainer::ToolbarButtonContainer( ...@@ -674,6 +679,7 @@ WebAppFrameToolbarView::ToolbarButtonContainer::ToolbarButtonContainer(
views::SetHitTestComponent(browser_actions_container_, views::SetHitTestComponent(browser_actions_container_,
static_cast<int>(HTCLIENT)); static_cast<int>(HTCLIENT));
} }
}
if (app_controller->HasTitlebarMenuButton()) { if (app_controller->HasTitlebarMenuButton()) {
// TODO(crbug.com/998900): Create AppControllerUi class to contain this logic. // TODO(crbug.com/998900): Create AppControllerUi class to contain this logic.
......
...@@ -223,6 +223,12 @@ IN_PROC_BROWSER_TEST_F(AppBrowserControllerBrowserTest, ...@@ -223,6 +223,12 @@ IN_PROC_BROWSER_TEST_F(AppBrowserControllerBrowserTest,
InstallAndLaunchMockPopup(); InstallAndLaunchMockPopup();
EXPECT_EQ(BrowserList::GetInstance()->size(), 2u); EXPECT_EQ(BrowserList::GetInstance()->size(), 2u);
} }
IN_PROC_BROWSER_TEST_F(AppBrowserControllerBrowserTest,
NoExtensionsContainerExists) {
InstallAndLaunchMockPopup();
EXPECT_EQ(app_browser_->window()->GetExtensionsContainer(), nullptr);
}
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment