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

Unified Diff: chrome/browser/previews/previews_infobar_delegate.h

Issue 2250223002: Add InfoBar delegate for previews (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/previews/previews_infobar_delegate.h
diff --git a/chrome/browser/previews/previews_infobar_delegate.h b/chrome/browser/previews/previews_infobar_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..3af96470ab2e75d654ad8d3cef96090522790969
--- /dev/null
+++ b/chrome/browser/previews/previews_infobar_delegate.h
@@ -0,0 +1,54 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_
+
+#include "components/infobars/core/confirm_infobar_delegate.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace data_reduction_proxy {
+class DataReductionProxySettings;
Peter Kasting 2016/08/24 21:58:00 This forward-decl is no longer needed.
megjablon 2016/08/24 22:23:43 Done.
+}
+
+class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ // The type of the infobar. It controls the strings and what UMA data is
+ // recorded for the infobar.
+ enum PreviewsInfoBarType {
+ LOFI, // Server-side image replacement.
+ LITE_PAGE, // Server-side page rewrite.
+ OFFLINE, // Offline copy of the page.
+ };
+
+ ~PreviewsInfoBarDelegate() override;
+
+ // Creates a preview infobar and corresponding delegate and adds the infobar
+ // to InfoBarService. |infobar_type| controls the strings and what UMA data is
+ // recorded for the infobar.
Peter Kasting 2016/08/24 21:58:00 Nit: Now that this second sentence is verbatim wit
megjablon 2016/08/24 22:23:43 I'm good with removing it.
+ static void Create(content::WebContents* web_contents,
+ PreviewsInfoBarType infobar_type);
+
+ private:
+ PreviewsInfoBarDelegate(content::WebContents* web_contents,
+ PreviewsInfoBarType infobar_type);
+
+ // ConfirmInfoBarDelegate overrides:
Peter Kasting 2016/08/24 21:58:00 Nit: " overrides" not necessary
megjablon 2016/08/24 22:23:43 Done.
+ infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
+ int GetIconId() const override;
+ bool ShouldExpire(const NavigationDetails& details) const override;
+ base::string16 GetMessageText() const override;
+ int GetButtons() const override;
+ base::string16 GetLinkText() const override;
+ bool LinkClicked(WindowOpenDisposition disposition) override;
+
+ PreviewsInfoBarType infobar_type_;
+
+ DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate);
+};
+
+#endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698