Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Side by Side Diff: chrome/browser/previews/previews_infobar_delegate.h

Issue 2820793003: Track Previews infobar dismissals due to tab closure (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/previews/previews_infobar_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "components/infobars/core/confirm_infobar_delegate.h" 10 #include "components/infobars/core/confirm_infobar_delegate.h"
(...skipping 19 matching lines...) Expand all
30 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback; 30 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback;
31 31
32 // Actions on the previews infobar. This enum must remain synchronized with 32 // Actions on the previews infobar. This enum must remain synchronized with
33 // the enum of the same name in metrics/histograms/histograms.xml. 33 // the enum of the same name in metrics/histograms/histograms.xml.
34 enum PreviewsInfoBarAction { 34 enum PreviewsInfoBarAction {
35 INFOBAR_SHOWN = 0, 35 INFOBAR_SHOWN = 0,
36 INFOBAR_LOAD_ORIGINAL_CLICKED = 1, 36 INFOBAR_LOAD_ORIGINAL_CLICKED = 1,
37 INFOBAR_DISMISSED_BY_USER = 2, 37 INFOBAR_DISMISSED_BY_USER = 2,
38 INFOBAR_DISMISSED_BY_NAVIGATION = 3, 38 INFOBAR_DISMISSED_BY_NAVIGATION = 3,
39 INFOBAR_DISMISSED_BY_RELOAD = 4, 39 INFOBAR_DISMISSED_BY_RELOAD = 4,
40 INFOBAR_DISMISSED_BY_TAB_CLOSURE = 5,
40 INFOBAR_INDEX_BOUNDARY 41 INFOBAR_INDEX_BOUNDARY
41 }; 42 };
42 43
43 ~PreviewsInfoBarDelegate() override; 44 ~PreviewsInfoBarDelegate() override;
44 45
45 // Creates a preview infobar and corresponding delegate and adds the infobar 46 // Creates a preview infobar and corresponding delegate and adds the infobar
46 // to InfoBarService. 47 // to InfoBarService.
47 static void Create( 48 static void Create(
48 content::WebContents* web_contents, 49 content::WebContents* web_contents,
49 PreviewsInfoBarType infobar_type, 50 PreviewsInfoBarType infobar_type,
(...skipping 11 matching lines...) Expand all
61 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; 62 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
62 int GetIconId() const override; 63 int GetIconId() const override;
63 bool ShouldExpire(const NavigationDetails& details) const override; 64 bool ShouldExpire(const NavigationDetails& details) const override;
64 void InfoBarDismissed() override; 65 void InfoBarDismissed() override;
65 base::string16 GetMessageText() const override; 66 base::string16 GetMessageText() const override;
66 int GetButtons() const override; 67 int GetButtons() const override;
67 base::string16 GetLinkText() const override; 68 base::string16 GetLinkText() const override;
68 bool LinkClicked(WindowOpenDisposition disposition) override; 69 bool LinkClicked(WindowOpenDisposition disposition) override;
69 70
70 PreviewsInfoBarType infobar_type_; 71 PreviewsInfoBarType infobar_type_;
72 mutable PreviewsInfoBarAction infobar_dismissed_action_;
71 73
72 const base::string16 message_text_; 74 const base::string16 message_text_;
73 75
74 OnDismissPreviewsInfobarCallback on_dismiss_callback_; 76 OnDismissPreviewsInfobarCallback on_dismiss_callback_;
75 77
76 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); 78 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate);
77 }; 79 };
78 80
79 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ 81 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/previews/previews_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698