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 namespace infobars { | |
18 class InfoBarManager; | |
19 } | |
Peter Kasting
2014/12/19 23:06:23
This forward-decl doesn't seem to be needed?
sdefresne
2014/12/20 11:30:55
It is in fact required to allow Android code to pr
Peter Kasting
2014/12/22 19:22:05
I don't understand why the forward-decl is needed
sdefresne
2014/12/22 20:48:41
Sorry, I was again unclear. I planned to remove th
| |
20 | |
17 // 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 |
18 // explicitly dismissed. This InfoBar is suitable for displaying a message | 22 // explicitly dismissed. This InfoBar is suitable for displaying a message |
19 // 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. |
20 class DataReductionProxyInfoBarDelegate : public ConfirmInfoBarDelegate { | 24 class DataReductionProxyInfoBarDelegate : public ConfirmInfoBarDelegate { |
21 public: | 25 public: |
22 // Creates the InfoBar and adds it to the provided |web_contents|. | 26 // Creates the InfoBar and adds it to the provided |web_contents|. |
23 static void Create(content::WebContents* web_contents, | 27 static void Create(content::WebContents* web_contents, |
24 const std::string& link_url); | 28 const std::string& link_url); |
25 | 29 |
26 ~DataReductionProxyInfoBarDelegate() override; | 30 ~DataReductionProxyInfoBarDelegate() override; |
27 | 31 |
28 private: | 32 private: |
29 explicit DataReductionProxyInfoBarDelegate(const std::string& link_url); | 33 explicit DataReductionProxyInfoBarDelegate(const std::string& link_url); |
30 | 34 |
31 // Returns a Data Reduction Proxy infobar that owns |delegate|. | |
32 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | |
33 scoped_ptr<DataReductionProxyInfoBarDelegate> delegate); | |
34 | |
35 // ConfirmInfoBarDelegate | 35 // ConfirmInfoBarDelegate |
36 base::string16 GetMessageText() const override; | 36 base::string16 GetMessageText() const override; |
37 int GetButtons() const override; | 37 int GetButtons() const override; |
38 bool ShouldExpire(const NavigationDetails& details) const override; | 38 bool ShouldExpire(const NavigationDetails& details) const override; |
39 bool LinkClicked(WindowOpenDisposition disposition) override; | 39 bool LinkClicked(WindowOpenDisposition disposition) override; |
40 | 40 |
41 std::string link_url_; | 41 std::string link_url_; |
42 | 42 |
43 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyInfoBarDelegate); | 43 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyInfoBarDelegate); |
44 }; | 44 }; |
45 | 45 |
46 #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 |