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

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

Issue 2848293002: Adding the Previews infobar to pages that show a client LoFi image (Closed)
Patch Set: merged lofis Created 3 years, 7 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
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"
11 11
12 namespace content { 12 namespace content {
13 class WebContents; 13 class WebContents;
14 } 14 }
15 15
16 // Shows an infobar that lets the user know that a preview page has been loaded, 16 // Shows an infobar that lets the user know that a preview page has been loaded,
17 // and gives the user a link to reload the original page. This infobar will only 17 // and gives the user a link to reload the original page. This infobar will only
18 // be shown once per page load. Records UMA data for user interactions with the 18 // be shown once per page load. Records UMA data for user interactions with the
19 // infobar. 19 // infobar.
20 class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate { 20 class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate {
21 public: 21 public:
22 // The type of the infobar. It controls the strings and what UMA data is 22 // The type of the infobar. It controls the strings and what UMA data is
23 // recorded for the infobar. 23 // recorded for the infobar.
24 // TODO(ryansturm): Combine PreviewsInfoBarType with previews::PreviewsType.
25 // crbug.com/704335
24 enum PreviewsInfoBarType { 26 enum PreviewsInfoBarType {
25 LOFI, // Server-side image replacement. 27 LOFI, // Server-side image replacement.
sclittle 2017/05/08 20:28:01 nit: could you update the comment here to indicate
RyanSturm 2017/05/08 20:36:03 Done.
26 LITE_PAGE, // Server-side page rewrite. 28 LITE_PAGE, // Server-side page rewrite.
27 OFFLINE, // Offline copy of the page. 29 OFFLINE, // Offline copy of the page.
28 }; 30 };
29 31
30 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback; 32 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback;
31 33
32 // Actions on the previews infobar. This enum must remain synchronized with 34 // Actions on the previews infobar. This enum must remain synchronized with
33 // the enum of the same name in metrics/histograms/histograms.xml. 35 // the enum of the same name in metrics/histograms/histograms.xml.
34 enum PreviewsInfoBarAction { 36 enum PreviewsInfoBarAction {
35 INFOBAR_SHOWN = 0, 37 INFOBAR_SHOWN = 0,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 mutable PreviewsInfoBarAction infobar_dismissed_action_; 74 mutable PreviewsInfoBarAction infobar_dismissed_action_;
73 75
74 const base::string16 message_text_; 76 const base::string16 message_text_;
75 77
76 OnDismissPreviewsInfobarCallback on_dismiss_callback_; 78 OnDismissPreviewsInfobarCallback on_dismiss_callback_;
77 79
78 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); 80 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate);
79 }; 81 };
80 82
81 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ 83 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698