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

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: Addressed comments from marq and tedchoc 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..5be0b9c19860dd0dc96c74b1ec503f4e956ee5fb 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 true;
+}

Powered by Google App Engine
This is Rietveld 408576698