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