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

Unified Diff: chrome/browser/previews/previews_infobar_delegate.cc

Issue 2256383002: Add PreviewsInfoBarTabHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newLoFiInfoBarWithoutPercent
Patch Set: rebase Created 4 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/previews/previews_infobar_tab_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/previews/previews_infobar_delegate.cc
diff --git a/chrome/browser/previews/previews_infobar_delegate.cc b/chrome/browser/previews/previews_infobar_delegate.cc
index df13511b734b951260e0736a9023cb3e11624193..adb4ed8b89ffbf6d88cfcb77a7298c9714734b73 100644
--- a/chrome/browser/previews/previews_infobar_delegate.cc
+++ b/chrome/browser/previews/previews_infobar_delegate.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.h"
+#include "chrome/browser/previews/previews_infobar_tab_helper.h"
#include "chrome/grit/generated_resources.h"
#include "components/infobars/core/infobar.h"
#include "content/public/browser/render_frame_host.h"
@@ -19,7 +20,10 @@ PreviewsInfoBarDelegate::~PreviewsInfoBarDelegate() {}
// static
void PreviewsInfoBarDelegate::Create(content::WebContents* web_contents,
PreviewsInfoBarType infobar_type) {
- // TODO(megjablon): Check that the infobar was not already shown.
+ PreviewsInfoBarTabHelper* infobar_tab_helper =
+ PreviewsInfoBarTabHelper::FromWebContents(web_contents);
+ if (infobar_tab_helper->displayed_preview_infobar())
+ return;
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
@@ -35,6 +39,8 @@ void PreviewsInfoBarDelegate::Create(content::WebContents* web_contents,
web_contents->GetBrowserContext());
data_reduction_proxy_settings->IncrementLoFiUIShown();
}
+
+ infobar_tab_helper->set_displayed_preview_infobar(true);
}
PreviewsInfoBarDelegate::PreviewsInfoBarDelegate(
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/previews/previews_infobar_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698