Chromium Code Reviews| 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_H_ |
| 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_INFOBAR_DELEGATE_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 // Configures an InfoBar with no buttons that stays visible until it is | 17 // Configures an InfoBar with no buttons that stays visible until it is |
| 18 // explicitly dismissed. This InfoBar is suitable for displaying a message | 18 // explicitly dismissed. This InfoBar is suitable for displaying a message |
| 19 // and a link, and is used only by an Android field trial. | 19 // and a link, and is used only by an Android field trial. |
|
marq (ping after 24h)
2014/09/18 17:45:46
Is this still true? If not -- if iOS support is ne
bengr
2014/09/18 18:01:15
This is still true.
| |
| 20 class DataReductionProxyInfoBarDelegate : public ConfirmInfoBarDelegate { | 20 class DataReductionProxyInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 21 public: | 21 public: |
| 22 // Creates the InfoBar and adds it to the provided |web_contents|. | 22 // Creates the InfoBar and adds it to the provided |web_contents|. |
| 23 static void Create(content::WebContents* web_contents); | 23 static void Create(content::WebContents* web_contents, |
| 24 const std::string& link_url); | |
| 24 | 25 |
| 25 virtual ~DataReductionProxyInfoBarDelegate(); | 26 virtual ~DataReductionProxyInfoBarDelegate(); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 DataReductionProxyInfoBarDelegate(); | 29 explicit DataReductionProxyInfoBarDelegate(const std::string& link_url); |
| 29 | 30 |
| 30 // Returns a Data Reduction Proxy infobar that owns |delegate|. | 31 // Returns a Data Reduction Proxy infobar that owns |delegate|. |
| 31 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | 32 static scoped_ptr<infobars::InfoBar> CreateInfoBar( |
| 32 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate); | 33 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate); |
| 33 | 34 |
| 34 // ConfirmInfoBarDelegate | 35 // ConfirmInfoBarDelegate |
| 35 virtual base::string16 GetMessageText() const OVERRIDE; | 36 virtual base::string16 GetMessageText() const OVERRIDE; |
| 36 virtual int GetButtons() const OVERRIDE; | 37 virtual int GetButtons() const OVERRIDE; |
| 37 virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE; | 38 virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE; |
| 39 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; | |
| 40 | |
| 41 std::string link_url_; | |
| 38 | 42 |
| 39 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyInfoBarDelegate); | 43 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyInfoBarDelegate); |
| 40 }; | 44 }; |
| 41 | 45 |
| 42 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_INFOBAR_DELEGATE_H_ | 46 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_INFOBAR_DELEGATE_H_ |
| OLD | NEW |