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 package org.chromium.chrome.browser.infobar; | 5 package org.chromium.chrome.browser.infobar; |
6 | 6 |
7 import org.chromium.content_public.browser.WebContents; | 7 import org.chromium.content_public.browser.WebContents; |
8 | 8 |
9 /** | 9 /** |
10 * Generates an InfoBar for the data reduction proxy that contains a message and
a link to the | 10 * Generates an InfoBar for the data reduction proxy that contains a message and
a link to the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 public static void launch(WebContents webContents, | 25 public static void launch(WebContents webContents, |
26 String title, | 26 String title, |
27 String linkText, | 27 String linkText, |
28 String linkUrl) { | 28 String linkUrl) { |
29 sTitle = title; | 29 sTitle = title; |
30 sLinkText = linkText; | 30 sLinkText = linkText; |
31 DataReductionProxyInfoBarDelegate.launch(webContents, linkUrl); | 31 DataReductionProxyInfoBarDelegate.launch(webContents, linkUrl); |
32 } | 32 } |
33 | 33 |
34 DataReductionProxyInfoBar(long nativeInfoBar, int iconDrawableId) { | 34 DataReductionProxyInfoBar(int iconDrawableId) { |
35 super(nativeInfoBar, null, iconDrawableId, null, sTitle, sLinkText, null
, null); | 35 super(null, iconDrawableId, null, sTitle, sLinkText, null, null); |
36 } | 36 } |
37 | 37 |
38 @Override | 38 @Override |
39 public void createContent(InfoBarLayout layout) { | 39 public void createContent(InfoBarLayout layout) { |
40 layout.setButtons(sLinkText, null); | 40 layout.setButtons(sLinkText, null); |
41 } | 41 } |
42 | 42 |
43 @Override | 43 @Override |
44 public void onButtonClicked(boolean isPrimaryButton) { | 44 public void onButtonClicked(boolean isPrimaryButton) { |
45 if (!isPrimaryButton) return; | 45 if (!isPrimaryButton) return; |
46 onLinkClicked(); | 46 onLinkClicked(); |
47 } | 47 } |
48 } | 48 } |
OLD | NEW |