Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | |
| 6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | |
| 7 | |
| 8 #include "components/infobars/core/confirm_infobar_delegate.h" | |
| 9 | |
| 10 namespace content { | |
| 11 class WebContents; | |
| 12 } | |
| 13 | |
| 14 // Shows an infobar that lets the user know that a preview page has been loaded, | |
| 15 // and gives the user a link to reload the original page. This infobar will only | |
| 16 // be shown once per page load. Records uma data for user interactions with the | |
|
bengr
2016/08/31 23:37:34
uma -> UMA
megjablon
2016/09/08 00:25:45
Done.
| |
| 17 // infobar. | |
| 18 class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate { | |
| 19 public: | |
| 20 // The type of the infobar. It controls the strings and what UMA data is | |
| 21 // recorded for the infobar. | |
| 22 enum PreviewsInfoBarType { | |
| 23 LOFI, // Server-side image replacement. | |
| 24 LITE_PAGE, // Server-side page rewrite. | |
| 25 OFFLINE, // Offline copy of the page. | |
| 26 }; | |
| 27 | |
| 28 ~PreviewsInfoBarDelegate() override; | |
| 29 | |
| 30 // Creates a preview infobar and corresponding delegate and adds the infobar | |
| 31 // to InfoBarService. | |
| 32 static void Create(content::WebContents* web_contents, | |
| 33 PreviewsInfoBarType infobar_type); | |
| 34 | |
| 35 private: | |
| 36 PreviewsInfoBarDelegate(content::WebContents* web_contents, | |
| 37 PreviewsInfoBarType infobar_type); | |
| 38 | |
| 39 // ConfirmInfoBarDelegate overrides: | |
| 40 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | |
| 41 int GetIconId() const override; | |
| 42 bool ShouldExpire(const NavigationDetails& details) const override; | |
| 43 base::string16 GetMessageText() const override; | |
| 44 int GetButtons() const override; | |
| 45 base::string16 GetLinkText() const override; | |
| 46 bool LinkClicked(WindowOpenDisposition disposition) override; | |
| 47 | |
| 48 PreviewsInfoBarType infobar_type_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); | |
| 51 }; | |
| 52 | |
| 53 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | |
| OLD | NEW |