-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dPWA] Move desktop intent picker behavior under desktop PWA flag
This CL moves the intent picker behavior for desktop (non-CrOS) under the kDesktopPWAsLinkCapturing flag. As a result of this, the following changes are made: 1. Ensuring the 2 different flags for CrOS and desktop are each taken into account per platform when invoked from multiple places. 2. This fixes crbug.com/1491258, where the OneOffIconObserver is deprecated in favor of an IntentChipButton observer. 3. Tests are updated with the new flag which helps verify that the desktop implementation works with all preexisting tests. Bug: 1412856, b/304411994 Change-Id: I4712146637bbcd3fdc2a66a53f298e4c270eb5a0 Fixed: 1491258 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4967393 Reviewed-by: Mike Wasserman <msw@chromium.org> Reviewed-by: Maggie Cai <mxcai@chromium.org> Commit-Queue: Dibyajyoti Pal <dibyapal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1217169}
- Loading branch information
Showing
17 changed files
with
198 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
chrome/browser/apps/link_capturing/link_capturing_feature_test_support.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2023 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/apps/link_capturing/link_capturing_feature_test_support.h" | ||
|
||
#include "base/check_is_test.h" | ||
#include "base/test/scoped_feature_list.h" | ||
|
||
namespace apps { | ||
|
||
void EnableLinkCapturingUXForTesting( | ||
base::test::ScopedFeatureList& scoped_feature_list) { | ||
CHECK_IS_TEST(); | ||
#if BUILDFLAG(IS_CHROMEOS) | ||
scoped_feature_list.InitAndEnableFeature( | ||
apps::features::kLinkCapturingUiUpdate); | ||
#else | ||
scoped_feature_list.InitAndEnableFeature( | ||
apps::features::kDesktopPWAsLinkCapturing); | ||
#endif // BUILDFLAG(IS_CHROMEOS) | ||
} | ||
|
||
void DisableLinkCapturingUXForTesting( | ||
base::test::ScopedFeatureList& scoped_feature_list) { | ||
CHECK_IS_TEST(); | ||
#if BUILDFLAG(IS_CHROMEOS) | ||
scoped_feature_list.InitAndDisableFeature( | ||
apps::features::kLinkCapturingUiUpdate); | ||
#else | ||
scoped_feature_list.InitAndDisableFeature( | ||
apps::features::kDesktopPWAsLinkCapturing); | ||
#endif // BUILDFLAG(IS_CHROMEOS) | ||
} | ||
|
||
} // namespace apps |
25 changes: 25 additions & 0 deletions
25
chrome/browser/apps/link_capturing/link_capturing_feature_test_support.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_APPS_LINK_CAPTURING_LINK_CAPTURING_FEATURE_TEST_SUPPORT_H_ | ||
#define CHROME_BROWSER_APPS_LINK_CAPTURING_LINK_CAPTURING_FEATURE_TEST_SUPPORT_H_ | ||
|
||
#include "base/test/scoped_feature_list.h" | ||
#include "chrome/browser/apps/link_capturing/link_capturing_features.h" | ||
|
||
namespace apps { | ||
|
||
// The functions should only be called from tests, and is used to enable or | ||
// disable link capturing UXes. Only use these if link capturing needs to be | ||
// enabled on all platforms, i.e. ChromeOS, Windows, Mac and Linux. For platform | ||
// specific implementations, prefer initializing the feature list in the test | ||
// file itself. | ||
void EnableLinkCapturingUXForTesting( | ||
base::test::ScopedFeatureList& scoped_feature_list); | ||
void DisableLinkCapturingUXForTesting( | ||
base::test::ScopedFeatureList& scoped_feature_list); | ||
|
||
} // namespace apps | ||
|
||
#endif // CHROME_BROWSER_APPS_LINK_CAPTURING_LINK_CAPTURING_FEATURE_TEST_SUPPORT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.