Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6698)

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc

Issue 581833002: Updated alternative data reduction proxy UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@flag-for-ssl-experiment
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc
index c959ddca793ae13cdb328f5f9664fb003a915fd3..f16061a94f3599d713cd532f101c4763832157de 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc
@@ -9,14 +9,17 @@
#include "components/infobars/core/infobar.h"
#include "components/infobars/core/infobar_delegate.h"
#include "content/public/browser/web_contents.h"
+#include "grit/components_strings.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "url/gurl.h"
// static
void DataReductionProxyInfoBarDelegate::Create(
- content::WebContents* web_contents) {
+ content::WebContents* web_contents, const std::string& link_url) {
InfoBarService::FromWebContents(web_contents)->AddInfoBar(
DataReductionProxyInfoBarDelegate::CreateInfoBar(
scoped_ptr<DataReductionProxyInfoBarDelegate>(
- new DataReductionProxyInfoBarDelegate())));
+ new DataReductionProxyInfoBarDelegate(link_url))));
}
#if !defined(OS_ANDROID)
@@ -33,8 +36,10 @@ scoped_ptr<infobars::InfoBar> DataReductionProxyInfoBarDelegate::CreateInfoBar(
DataReductionProxyInfoBarDelegate::~DataReductionProxyInfoBarDelegate() {
}
-DataReductionProxyInfoBarDelegate::DataReductionProxyInfoBarDelegate()
- : ConfirmInfoBarDelegate() {
+DataReductionProxyInfoBarDelegate::DataReductionProxyInfoBarDelegate(
+ const std::string& link_url)
+ : ConfirmInfoBarDelegate(),
+ link_url_(link_url) {
}
bool DataReductionProxyInfoBarDelegate::ShouldExpire(
@@ -49,3 +54,14 @@ base::string16 DataReductionProxyInfoBarDelegate::GetMessageText() const {
int DataReductionProxyInfoBarDelegate::GetButtons() const {
return BUTTON_NONE;
}
+
+bool DataReductionProxyInfoBarDelegate::LinkClicked(
+ WindowOpenDisposition disposition) {
+ InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
+ content::OpenURLParams(
+ GURL(link_url_),
+ content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false));
+ return false;
Ted C 2014/09/18 00:40:21 does something else handle closing this? Just won
bengr 2014/09/18 18:01:15 Because I mistakenly assumed it was being closed.
+}

Powered by Google App Engine
This is Rietveld 408576698