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 class PreviewsInfoBarDelegate : public ConfirmInfoBarDelegate { | |
bengr
2016/08/25 23:26:19
Please add a class comment.
megjablon
2016/08/26 22:47:30
Done.
| |
15 public: | |
16 // The type of the infobar. It controls the strings and what UMA data is | |
bengr
2016/08/25 23:26:19
Strings shoudn't be affected.
megjablon
2016/08/26 22:47:30
The offline infobar gets "Faster page loaded." ins
| |
17 // recorded for the infobar. | |
18 enum PreviewsInfoBarType { | |
19 LOFI, // Server-side image replacement. | |
20 LITE_PAGE, // Server-side page rewrite. | |
21 OFFLINE, // Offline copy of the page. | |
22 }; | |
23 | |
24 ~PreviewsInfoBarDelegate() override; | |
25 | |
26 // Creates a preview infobar and corresponding delegate and adds the infobar | |
27 // to InfoBarService. | |
28 static void Create(content::WebContents* web_contents, | |
29 PreviewsInfoBarType infobar_type); | |
30 | |
31 private: | |
32 PreviewsInfoBarDelegate(content::WebContents* web_contents, | |
33 PreviewsInfoBarType infobar_type); | |
34 | |
35 // ConfirmInfoBarDelegate: | |
bengr
2016/08/25 23:26:19
add the word "overrides"
megjablon
2016/08/26 22:47:30
Adding this back in. pkasting asked me to remove i
Peter Kasting
2016/08/27 03:42:22
Heh.
There's no consistency across the codebase.
| |
36 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | |
37 int GetIconId() const override; | |
38 bool ShouldExpire(const NavigationDetails& details) const override; | |
39 base::string16 GetMessageText() const override; | |
40 int GetButtons() const override; | |
41 base::string16 GetLinkText() const override; | |
42 bool LinkClicked(WindowOpenDisposition disposition) override; | |
43 | |
44 PreviewsInfoBarType infobar_type_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(PreviewsInfoBarDelegate); | |
47 }; | |
48 | |
49 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_INFOBAR_DELEGATE_H_ | |
OLD | NEW |