Commit 2d326206 authored by Louise Brett's avatar Louise Brett Committed by Chromium LUCI CQ

Change attention badging flag default to api-only

Bug: 1157273
Change-Id: I5531b30ccc8c2ce4d956c67880d1a74d93754073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2619243Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Commit-Queue: Louise Brett <loubrett@google.com>
Cr-Commit-Position: refs/heads/master@{#842386}
parent be551c4a
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "chrome/browser/notifications/profile_notification.h" #include "chrome/browser/notifications/profile_notification.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h" #include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h"
#include "chrome/common/chrome_switches.h"
#include "components/arc/arc_service_manager.h" #include "components/arc/arc_service_manager.h"
#include "components/arc/arc_util.h" #include "components/arc/arc_util.h"
#include "components/arc/session/arc_bridge_service.h" #include "components/arc/session/arc_bridge_service.h"
...@@ -265,6 +266,13 @@ class AppNotificationsWebNotificationTest ...@@ -265,6 +266,13 @@ class AppNotificationsWebNotificationTest
ASSERT_TRUE(https_server_.Start()); ASSERT_TRUE(https_server_.Start());
} }
void SetUpCommandLine(base::CommandLine* command_line) override {
extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line);
command_line->AppendSwitchASCII(
switches::kDesktopPWAsAttentionBadgingCrOS,
switches::kDesktopPWAsAttentionBadgingCrOSApiAndNotifications);
}
std::string CreateWebApp(const GURL& url, const GURL& scope) const { std::string CreateWebApp(const GURL& url, const GURL& scope) const {
auto web_app_info = std::make_unique<WebApplicationInfo>(); auto web_app_info = std::make_unique<WebApplicationInfo>();
web_app_info->start_url = url; web_app_info->start_url = url;
......
...@@ -70,7 +70,7 @@ std::string GetDesktopPWAsAttentionBadgingFlag() { ...@@ -70,7 +70,7 @@ std::string GetDesktopPWAsAttentionBadgingFlag() {
return cmdline->GetSwitchValueASCII( return cmdline->GetSwitchValueASCII(
switches::kDesktopPWAsAttentionBadgingCrOS); switches::kDesktopPWAsAttentionBadgingCrOS);
} }
return ""; return switches::kDesktopPWAsAttentionBadgingCrOSApiOnly;
} }
} // namespace } // namespace
...@@ -556,9 +556,8 @@ apps::mojom::OptionalBool WebAppsChromeOs::ShouldShowBadge( ...@@ -556,9 +556,8 @@ apps::mojom::OptionalBool WebAppsChromeOs::ShouldShowBadge(
// Show a badge only if a notification is showing. // Show a badge only if a notification is showing.
return has_notification; return has_notification;
} else { } else {
// When the flag is not set or set to "api-and-notifications" we show a // When the flag is set to "api-and-notifications" we show a badge if either
// badge if either a notification is showing or the Web Badging API has a // a notification is showing or the Web Badging API has a badge set.
// badge set.
return badge_manager_ && badge_manager_->GetBadgeValue(app_id).has_value() return badge_manager_ && badge_manager_->GetBadgeValue(app_id).has_value()
? apps::mojom::OptionalBool::kTrue ? apps::mojom::OptionalBool::kTrue
: has_notification; : has_notification;
......
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