| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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_NET_SPDYPROXY_DATA_REDUCTION_PROXY_INFOBAR_DELEGATE_ANDRO
ID_H_ | |
| 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_INFOBAR_DELEGATE_ANDRO
ID_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "components/infobars/core/confirm_infobar_delegate.h" | |
| 12 #include "components/infobars/core/infobar_delegate.h" | |
| 13 | |
| 14 namespace content { | |
| 15 class WebContents; | |
| 16 } | |
| 17 | |
| 18 namespace infobars { | |
| 19 class InfoBarManager; | |
| 20 } | |
| 21 | |
| 22 // Configures an InfoBar with no buttons that stays visible until it is | |
| 23 // explicitly dismissed. This InfoBar is suitable for displaying a message | |
| 24 // and a link, and is used only by an Android field trial. | |
| 25 class DataReductionProxyInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { | |
| 26 public: | |
| 27 // Creates the InfoBar and adds it to the provided |web_contents|. | |
| 28 static void Create(content::WebContents* web_contents, | |
| 29 const std::string& link_url); | |
| 30 | |
| 31 ~DataReductionProxyInfoBarDelegateAndroid() override; | |
| 32 | |
| 33 private: | |
| 34 explicit DataReductionProxyInfoBarDelegateAndroid( | |
| 35 const std::string& link_url); | |
| 36 | |
| 37 // Returns a Data Reduction Proxy infobar that owns |delegate|. | |
| 38 static std::unique_ptr<infobars::InfoBar> CreateInfoBar( | |
| 39 infobars::InfoBarManager* infobar_manager, | |
| 40 std::unique_ptr<DataReductionProxyInfoBarDelegateAndroid> delegate); | |
| 41 | |
| 42 // ConfirmInfoBarDelegate | |
| 43 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | |
| 44 bool ShouldExpire(const NavigationDetails& details) const override; | |
| 45 base::string16 GetMessageText() const override; | |
| 46 int GetButtons() const override; | |
| 47 GURL GetLinkURL() const override; | |
| 48 bool LinkClicked(WindowOpenDisposition disposition) override; | |
| 49 | |
| 50 std::string link_url_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyInfoBarDelegateAndroid); | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_INFOBAR_DELEGATE_AN
DROID_H_ | |
| OLD | NEW |