Skip to content

Commit

Permalink
[M116] Set source for UMA when creating Default browser settings VC
Browse files Browse the repository at this point in the history
Settings.DefaultBrowserFromSource reporting require to know what
action triggered the settings screen.

(cherry picked from commit 2987218)

Fixed: 1454432
Change-Id: I1c12e6a27953d9962d0ee6d3d590e96d80d13558
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4607295
Reviewed-by: David Jean <djean@chromium.org>
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1161119}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4640023
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Auto-Submit: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/branch-heads/5845@{#40}
Cr-Branched-From: 5a5dff6-refs/heads/main@{#1160321}
  • Loading branch information
robinolivier authored and Chromium LUCI CQ committed Jun 23, 2023
1 parent 9c52fc3 commit 06ed7b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,8 @@ - (void)showDefaultBrowserSettingsFromViewController:

self.settingsNavigationController =
[SettingsNavigationController defaultBrowserControllerForBrowser:browser
delegate:self];
delegate:self
sourceForUMA:source];
[baseViewController presentViewController:self.settingsNavigationController
animated:YES
completion:nil];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
class Browser;
@protocol BrowserCommands;
@protocol BrowsingDataCommands;
enum class DefaultBrowserPromoSource;
@protocol ImportDataControllerDelegate;
@protocol SnackbarCommands;
@class UserFeedbackData;
Expand Down Expand Up @@ -183,7 +184,8 @@ extern NSString* const kSettingsDoneButtonId;
defaultBrowserControllerForBrowser:(Browser*)browser
delegate:
(id<SettingsNavigationControllerDelegate>)
delegate;
delegate
sourceForUMA:(DefaultBrowserPromoSource)source;

// Creates a new ClearBrowsingDataTableViewController and the chrome
// around it. `browser` is the browser where settings are being displayed and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ @implementation SettingsNavigationController
defaultBrowserControllerForBrowser:(Browser*)browser
delegate:
(id<SettingsNavigationControllerDelegate>)
delegate {
delegate
sourceForUMA:(DefaultBrowserPromoSource)source {
DCHECK(browser);
DefaultBrowserSettingsTableViewController* controller =
[[DefaultBrowserSettingsTableViewController alloc] init];
Expand All @@ -451,6 +452,7 @@ @implementation SettingsNavigationController
delegate:delegate];
[controller navigationItem].leftBarButtonItem =
[navigationController cancelButton];
controller.source = source;
return navigationController;
}

Expand Down

0 comments on commit 06ed7b2

Please sign in to comment.