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

Unified Diff: chrome/browser/ui/android/infobars/data_reduction_promo_infobar.cc

Issue 2022313002: UI for the Data Saver InfoBar Promo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@infobarPromo
Patch Set: dfalcantara comments 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/ui/android/infobars/data_reduction_promo_infobar.cc
diff --git a/chrome/browser/ui/android/infobars/data_reduction_promo_infobar.cc b/chrome/browser/ui/android/infobars/data_reduction_promo_infobar.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f33995a0cc076abfa11a68a45f1b272e03397e78
--- /dev/null
+++ b/chrome/browser/ui/android/infobars/data_reduction_promo_infobar.cc
@@ -0,0 +1,44 @@
+// 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/ui/android/infobars/data_reduction_promo_infobar.h"
+
+#include <utility>
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
+#include "base/logging.h"
+#include "chrome/browser/android/resource_mapper.h"
+#include "chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_android.h"
+#include "content/public/browser/web_contents.h"
+
+// DataReductionPromoInfoBar:
Peter Kasting 2016/06/29 06:44:44 Nit: I usually do "// DataReductionPromoInfoBar --
megjablon 2016/06/29 17:01:52 Done.
+
+DataReductionPromoInfoBar::DataReductionPromoInfoBar(
+ std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate)
+ : ConfirmInfoBar(std::move(delegate)) {}
+
+DataReductionPromoInfoBar::~DataReductionPromoInfoBar() {
+}
+
+base::android::ScopedJavaLocalRef<jobject>
+DataReductionPromoInfoBar::CreateRenderInfoBar(JNIEnv* env) {
+ return GetDelegate()->CreateRenderInfoBar(env);
+}
+
+DataReductionPromoInfoBarDelegateAndroid*
+DataReductionPromoInfoBar::GetDelegate() {
+ return static_cast<DataReductionPromoInfoBarDelegateAndroid*>(delegate());
+}
+
+// DataReductionPromoInfoBarDelegate:
+
+// static
+std::unique_ptr<infobars::InfoBar>
+DataReductionPromoInfoBarDelegateAndroid::CreateInfoBar(
+ infobars::InfoBarManager* infobar_manager,
+ std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate) {
+ return std::unique_ptr<infobars::InfoBar>(
Peter Kasting 2016/06/29 06:44:44 Nit: Prefer base::MakeUnique()
megjablon 2016/06/29 17:01:52 Done.
+ new DataReductionPromoInfoBar(std::move(delegate)));
+}

Powered by Google App Engine
This is Rietveld 408576698