#include "chrome/browser/ui/views/commerce/price_tracking_bubble_dialog_view.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/string_util.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/bookmarks/bookmark_editor.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/commerce/core/price_tracking_utils.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/view_tracker.h"
#include "ui/views/view_utils.h"
namespace {
std::unique_ptr<views::StyledLabel> CreateBodyLabel(std::u16string& body_text) { … }
}
DEFINE_ELEMENT_IDENTIFIER_VALUE(kPriceTrackingBubbleDialogId);
PriceTrackingBubbleDialogView::PriceTrackingBubbleDialogView(
View* anchor_view,
content::WebContents* web_contents,
Profile* profile,
const GURL& url,
ui::ImageModel image_model,
OnTrackPriceCallback on_track_price_callback,
Type type)
: … { … }
PriceTrackingBubbleDialogView::~PriceTrackingBubbleDialogView() = default;
void PriceTrackingBubbleDialogView::ShowBookmarkEditor() { … }
void PriceTrackingBubbleDialogView::OnAccepted(
OnTrackPriceCallback on_track_price_callback) { … }
void PriceTrackingBubbleDialogView::OnCanceled(
OnTrackPriceCallback on_track_price_callback) { … }
BEGIN_METADATA(…)
PriceTrackingBubbleCoordinator::PriceTrackingBubbleCoordinator(
views::View* anchor_view)
: … { … }
PriceTrackingBubbleCoordinator::~PriceTrackingBubbleCoordinator() = default;
void PriceTrackingBubbleCoordinator::OnWidgetDestroying(views::Widget* widget) { … }
void PriceTrackingBubbleCoordinator::Show(
content::WebContents* web_contents,
Profile* profile,
const GURL& url,
ui::ImageModel image_model,
PriceTrackingBubbleDialogView::OnTrackPriceCallback callback,
base::OnceClosure on_dialog_closing_callback,
PriceTrackingBubbleDialogView::Type type) { … }
void PriceTrackingBubbleCoordinator::Hide() { … }
PriceTrackingBubbleDialogView* PriceTrackingBubbleCoordinator::GetBubble()
const { … }
bool PriceTrackingBubbleCoordinator::IsShowing() { … }