Commit 4a43698a authored by Sébastien Séguin-Gagnon's avatar Sébastien Séguin-Gagnon Committed by Commit Bot

[SendTabToSelf] Record histogram for iOS infobar.

Record when the infobar is shown, opened and dismissed.

Bug: 942747
Change-Id: I76b8dbfc3538d7095eb2a9f0d4e96706954c0493
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1574833
Auto-Submit: sebsg <sebsg@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: sebsg <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652878}
parent 57027b6a
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/infobars/core/infobar.h" #include "components/infobars/core/infobar.h"
#include "components/send_tab_to_self/send_tab_to_self_entry.h" #include "components/send_tab_to_self/send_tab_to_self_entry.h"
#include "components/send_tab_to_self/send_tab_to_self_metrics.h"
#include "ios/chrome/grit/ios_theme_resources.h" #include "ios/chrome/grit/ios_theme_resources.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/strings/grit/ui_strings.h" #include "ui/strings/grit/ui_strings.h"
...@@ -27,6 +28,7 @@ IOSSendTabToSelfInfoBarDelegate::IOSSendTabToSelfInfoBarDelegate( ...@@ -27,6 +28,7 @@ IOSSendTabToSelfInfoBarDelegate::IOSSendTabToSelfInfoBarDelegate(
const SendTabToSelfEntry* entry) { const SendTabToSelfEntry* entry) {
DCHECK(entry); DCHECK(entry);
entry_ = entry; entry_ = entry;
RecordNotificationHistogram(SendTabToSelfNotification::kShown);
} }
infobars::InfoBarDelegate::InfoBarIdentifier infobars::InfoBarDelegate::InfoBarIdentifier
...@@ -64,19 +66,13 @@ GURL IOSSendTabToSelfInfoBarDelegate::GetLinkURL() const { ...@@ -64,19 +66,13 @@ GURL IOSSendTabToSelfInfoBarDelegate::GetLinkURL() const {
bool IOSSendTabToSelfInfoBarDelegate::LinkClicked( bool IOSSendTabToSelfInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) { WindowOpenDisposition disposition) {
RecordNotificationHistogram(SendTabToSelfNotification::kOpened);
infobar()->owner()->OpenURL(GetLinkURL(), disposition); infobar()->owner()->OpenURL(GetLinkURL(), disposition);
return true; return true;
} }
bool IOSSendTabToSelfInfoBarDelegate::Accept() {
// TODO(crbug.com/944602): Implement.
NOTIMPLEMENTED();
return true;
}
bool IOSSendTabToSelfInfoBarDelegate::Cancel() { bool IOSSendTabToSelfInfoBarDelegate::Cancel() {
// TODO(crbug.com/944602): Implement. RecordNotificationHistogram(SendTabToSelfNotification::kDismissed);
NOTIMPLEMENTED();
return true; return true;
} }
......
...@@ -35,7 +35,6 @@ class IOSSendTabToSelfInfoBarDelegate : public ConfirmInfoBarDelegate { ...@@ -35,7 +35,6 @@ class IOSSendTabToSelfInfoBarDelegate : public ConfirmInfoBarDelegate {
base::string16 GetLinkText() const override; base::string16 GetLinkText() const override;
GURL GetLinkURL() const override; GURL GetLinkURL() const override;
bool LinkClicked(WindowOpenDisposition disposition) override; bool LinkClicked(WindowOpenDisposition disposition) override;
bool Accept() override;
bool Cancel() override; bool Cancel() override;
// The entry that was share to this device. Must outlive this instance. // The entry that was share to this device. Must outlive this instance.
......
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