Commit e696cf9f authored by Collin Baker's avatar Collin Baker Committed by Commit Bot

Add comment to avoid using FeaturePromoBubbleView directly

As a stopgap before adding proper documentation, this comment
discourages use of FeaturePromoBubbleView and redirects users to
FeaturePromoController.

Bug: 1132335
Change-Id: Ia036dea11232645227d62124fd6683f1a74b32b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431767Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810710}
parent 007f904a
......@@ -27,9 +27,12 @@ namespace views {
class MdTextButton;
}
// NOTE: Avoid using this class directly. FeaturePromoController should
// be used in almost all cases.
//
// The FeaturePromoBubbleView is a special BubbleDialogDelegateView for
// in-product help which educates users about certain Chrome features in a
// deferred context.
// in-product help which educates users about certain Chrome features in
// a deferred context.
class FeaturePromoBubbleView : public views::BubbleDialogDelegateView {
public:
// Disallow copy and assign.
......@@ -37,6 +40,9 @@ class FeaturePromoBubbleView : public views::BubbleDialogDelegateView {
FeaturePromoBubbleView& operator=(const FeaturePromoBubbleView&) = delete;
~FeaturePromoBubbleView() override;
// NOTE: Please read comment above class. This method shouldn't be
// called in most cases.
//
// Creates the promo. The returned pointer is only valid until the
// widget is destroyed. It must not be manually deleted by the caller.
static FeaturePromoBubbleView* Create(
......
......@@ -23,6 +23,12 @@ class FeaturePromoController {
// components/feature_engagement/public/feature_list.cc and registered
// with |FeaturePromoRegistry|. Note that this is different than the
// feature that the IPH is showing for.
//
// For users that can't register their parameters with
// FeaturePromoRegistry, see
// |FeaturePromoControllerViews::MaybeShowPromoWithParams()|. Prefer
// statically registering params with FeaturePromoRegistry and using
// this method when possible.
virtual bool MaybeShowPromo(const base::Feature& iph_feature) = 0;
// Returns whether a bubble is showing for the given IPH. Note that if
......
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