-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[M106 Merge][side search] Add feature engagement for autotriggering
This CL integrates the autotriggering side search side panel feature with the feature egagement backend. This is only done for the unified side panel as experimentation will happen after this feature has fully rolled out. ShouldAutomaticallyTriggerAfterNavigation() has been added to the unified side panel controller to determine whether or not we should attempt to automatically trigger the side panel based on the following conditions: 1. The associated tab is the currently active browser tab 2. The side panel is not currently open to side search 3. The navigation is renderer initiated (i.e. not an omnibox or bookmark navigation) 4. We have navigated back to the same SRP within the tab 2 number of times (default, configurable by finch param) 5. The currently committed navigation is the first navigation away from the SRP The automatic triggering behavior is also configurable via the feature engagement backend. This can be used to control the window in which auto-triggering is reattempted and how frequently this occurs. int returned_to_previous_srp_count() has also replaced bool returned_to_previous_srp() in the tab helper to allow for count based (rather than boolean based) tracking for the number of times users return to the same SRP. To test enable IPH_SideSearchAutoTriggering as the in-product-help-demo-mode-choice in chrome://flags and use the following on the command line (ignore the newlines): --enable-features= SideSearch, SideSearchDSESupport, UnifiedSidePanel, SideSearchAutoTriggering:SideSearchAutoTriggeringReturnCount/1 Follow up will add additional metrics and tests. (cherry picked from commit 35268ca) Bug: 1354016 Change-Id: Id6890e0dbe045a55137d07f311d498da62839454 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3835658 Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org> Reviewed-by: Yuheng Huang <yuhengh@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1037325} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3850822 Cr-Commit-Position: refs/branch-heads/5249@{#49} Cr-Branched-From: 4f7bea5-refs/heads/main@{#1036826}
- Loading branch information
Thomas Lukaszewicz
authored and
Chromium LUCI CQ
committed
Aug 23, 2022
1 parent
1055f36
commit c951047
Showing
16 changed files
with
295 additions
and
29 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
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
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
24 changes: 24 additions & 0 deletions
24
chrome/browser/ui/views/side_search/side_search_views_utils.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,24 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// 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/side_search/side_search_views_utils.h" | ||
|
||
#include "chrome/browser/ui/ui_features.h" | ||
#include "chrome/browser/ui/views/frame/browser_view.h" | ||
#include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h" | ||
#include "chrome/browser/ui/views/side_panel/side_panel_entry.h" | ||
#include "chrome/browser/ui/views/side_search/side_search_browser_controller.h" | ||
|
||
namespace side_search { | ||
|
||
bool IsSideSearchToggleOpen(BrowserView* browser_view) { | ||
if (base::FeatureList::IsEnabled(features::kUnifiedSidePanel)) { | ||
auto* coordinator = browser_view->side_panel_coordinator(); | ||
return coordinator->IsSidePanelShowing() && | ||
coordinator->GetCurrentEntryId() == SidePanelEntry::Id::kSideSearch; | ||
} | ||
return browser_view->side_search_controller()->GetSidePanelToggledOpen(); | ||
} | ||
|
||
} // namespace side_search |
18 changes: 18 additions & 0 deletions
18
chrome/browser/ui/views/side_search/side_search_views_utils.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,18 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_UI_VIEWS_SIDE_SEARCH_SIDE_SEARCH_VIEWS_UTILS_H_ | ||
#define CHROME_BROWSER_UI_VIEWS_SIDE_SEARCH_SIDE_SEARCH_VIEWS_UTILS_H_ | ||
|
||
class BrowserView; | ||
|
||
namespace side_search { | ||
|
||
// Returns true if the side panel is open to the side search feature. This is | ||
// used by both the independent and unified side panel implementations. | ||
bool IsSideSearchToggleOpen(BrowserView* browser_view); | ||
|
||
} // namespace side_search | ||
|
||
#endif // CHROME_BROWSER_UI_VIEWS_SIDE_SEARCH_SIDE_SEARCH_VIEWS_UTILS_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
Oops, something went wrong.