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

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

Issue 2022313002: UI for the Data Saver InfoBar Promo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@infobarPromo
Patch Set: use app_icon Created 4 years, 6 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_promo_infobar_delegate_android.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.cc b/chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cf804c98d70ef7cecfc05bc72230d9edbdb8575d
--- /dev/null
+++ b/chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.cc
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.h"
+
+#include "chrome/browser/android/android_theme_resources.h"
+#include "chrome/browser/infobars/infobar_service.h"
+#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"
+
+// static
+void DataReductionPromoInfoBarDelegateAndroid::Create(
+ content::WebContents* web_contents) {
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ infobar_service->AddInfoBar(
+ DataReductionPromoInfoBarDelegateAndroid::CreateInfoBar(
+ infobar_service,
+ std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid>(
+ new DataReductionPromoInfoBarDelegateAndroid())));
+}
+
+DataReductionPromoInfoBarDelegateAndroid::
+ ~DataReductionPromoInfoBarDelegateAndroid() {}
Raj 2016/06/13 17:52:18 nit: This could be inline in the header file.
megjablon 2016/06/23 23:17:30 Done.
+
+DataReductionPromoInfoBarDelegateAndroid::
+ DataReductionPromoInfoBarDelegateAndroid()
+ : ConfirmInfoBarDelegate() {}
+
+infobars::InfoBarDelegate::InfoBarIdentifier
+DataReductionPromoInfoBarDelegateAndroid::GetIdentifier() const {
+ return DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID;
+}
+
+bool DataReductionPromoInfoBarDelegateAndroid::ShouldExpire(
+ const NavigationDetails& details) const {
+ return false;
+}
+
+base::string16 DataReductionPromoInfoBarDelegateAndroid::GetMessageText()
Raj 2016/06/13 17:52:18 Is this function needed ?
megjablon 2016/06/23 23:17:30 Yes, it is abstract so it needs to be overwritten.
+ const {
+ return base::string16();
+}
+
+int DataReductionPromoInfoBarDelegateAndroid::GetButtons() const {
Raj 2016/06/13 17:52:18 Is this function needed ?
megjablon 2016/06/23 23:17:30 Nope removed.
+ return BUTTON_OK | BUTTON_CANCEL;
+}

Powered by Google App Engine
This is Rietveld 408576698