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

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: removed range check 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.
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.
30 CLIENT_LOFI, // Client-side image replacement.
sclittle 2017/05/03 18:40:21 Since both Server LoFi and Client LoFi will often
RyanSturm 2017/05/03 18:48:52 I'd prefer to know the difference between the opt
sclittle 2017/05/03 19:02:47 Client LoFi tries to target all http:// and https:
28 }; 31 };
29 32
30 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback; 33 typedef base::Callback<void(bool opt_out)> OnDismissPreviewsInfobarCallback;
31 34
32 // Actions on the previews infobar. This enum must remain synchronized with 35 // Actions on the previews infobar. This enum must remain synchronized with
33 // the enum of the same name in metrics/histograms/histograms.xml. 36 // the enum of the same name in metrics/histograms/histograms.xml.
34 enum PreviewsInfoBarAction { 37 enum PreviewsInfoBarAction {
35 INFOBAR_SHOWN = 0, 38 INFOBAR_SHOWN = 0,
36 INFOBAR_LOAD_ORIGINAL_CLICKED = 1, 39 INFOBAR_LOAD_ORIGINAL_CLICKED = 1,
37 INFOBAR_DISMISSED_BY_USER = 2, 40 INFOBAR_DISMISSED_BY_USER = 2,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 mutable PreviewsInfoBarAction infobar_dismissed_action_; 75 mutable PreviewsInfoBarAction infobar_dismissed_action_;
73 76
74 const base::string16 message_text_; 77 const base::string16 message_text_;
75 78
76 OnDismissPreviewsInfobarCallback on_dismiss_callback_; 79 OnDismissPreviewsInfobarCallback on_dismiss_callback_;
77 80
78 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); 81 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate);
79 }; 82 };
80 83
81 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ 84 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698