Commit 40f1a755 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Fix InProductHelp for LongPress

This CL fixes an issue where the LongPress InProductHelp wasn't
displayed after displaying the BottomToolbar help as the event was
registered.
This CL registers the bottom_toolbar_opened event when the tip is shown.
It also fixes a couple a minor issues in the bubble presenter.

Bug: 877004
TBR: nyquist@chromium.org
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Id8c3906c6026ae84d1de09d9c953c2cea887f81d
Reviewed-on: https://chromium-review.googlesource.com/1186410Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585755}
parent 0e992a78
...@@ -33,6 +33,7 @@ const char kChromeOpened[] = "chrome_opened"; ...@@ -33,6 +33,7 @@ const char kChromeOpened[] = "chrome_opened";
const char kIncognitoTabOpened[] = "incognito_tab_opened"; const char kIncognitoTabOpened[] = "incognito_tab_opened";
const char kClearedBrowsingData[] = "cleared_browsing_data"; const char kClearedBrowsingData[] = "cleared_browsing_data";
const char kViewedReadingList[] = "viewed_reading_list"; const char kViewedReadingList[] = "viewed_reading_list";
const char kBottomToolbarOpened[] = "bottom_toolbar_opened";
#endif // defined(OS_IOS) #endif // defined(OS_IOS)
} // namespace events } // namespace events
......
...@@ -64,6 +64,9 @@ extern const char kClearedBrowsingData[]; ...@@ -64,6 +64,9 @@ extern const char kClearedBrowsingData[];
// The user has viewed their reading list. // The user has viewed their reading list.
extern const char kViewedReadingList[]; extern const char kViewedReadingList[];
// The user has viewed the the BottomToolbar tip.
extern const char kBottomToolbarOpened[];
#endif // defined(OS_IOS) #endif // defined(OS_IOS)
} // namespace events } // namespace events
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h" #include "base/metrics/user_metrics_action.h"
#include "components/feature_engagement/public/event_constants.h"
#include "components/feature_engagement/public/feature_constants.h" #include "components/feature_engagement/public/feature_constants.h"
#include "components/feature_engagement/public/tracker.h" #include "components/feature_engagement/public/tracker.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
...@@ -142,6 +143,7 @@ const CGFloat kBubblePresentationDelay = 1; ...@@ -142,6 +143,7 @@ const CGFloat kBubblePresentationDelay = 1;
[self.tabTipBubblePresenter dismissAnimated:NO]; [self.tabTipBubblePresenter dismissAnimated:NO];
[self.incognitoTabTipBubblePresenter dismissAnimated:NO]; [self.incognitoTabTipBubblePresenter dismissAnimated:NO];
[self.bottomToolbarTipBubblePresenter dismissAnimated:NO]; [self.bottomToolbarTipBubblePresenter dismissAnimated:NO];
[self.longPressToolbarTipBubblePresenter dismissAnimated:NO];
} }
- (void)userEnteredTabSwitcher { - (void)userEnteredTabSwitcher {
...@@ -208,7 +210,7 @@ const CGFloat kBubblePresentationDelay = 1; ...@@ -208,7 +210,7 @@ const CGFloat kBubblePresentationDelay = 1;
if (!presenter) if (!presenter)
return; return;
self.bottomToolbarTipBubblePresenter = presenter; self.longPressToolbarTipBubblePresenter = presenter;
} }
// Presents and returns a bubble view controller for the |feature| with an arrow // Presents and returns a bubble view controller for the |feature| with an arrow
...@@ -266,6 +268,8 @@ presentBubbleForFeature:(const base::Feature&)feature ...@@ -266,6 +268,8 @@ presentBubbleForFeature:(const base::Feature&)feature
return; return;
self.bottomToolbarTipBubblePresenter = presenter; self.bottomToolbarTipBubblePresenter = presenter;
feature_engagement::TrackerFactory::GetForBrowserState(self.browserState)
->NotifyEvent(feature_engagement::events::kBottomToolbarOpened);
} }
// Optionally presents a bubble associated with the new tab tip in-product help // Optionally presents a bubble associated with the new tab tip in-product help
......
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