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

Side by Side 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, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/android/infobars/data_reduction_promo_infobar.h"
6
7 #include <utility>
8
9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h"
11 #include "base/logging.h"
12 #include "chrome/browser/android/resource_mapper.h"
13 #include "chrome/browser/net/spdyproxy/data_reduction_promo_infobar_delegate_and roid.h"
14 #include "content/public/browser/web_contents.h"
15
16 // DataReductionPromoInfoBar:
Peter Kasting 2016/06/29 06:44:44 Nit: I usually do "// DataReductionPromoInfoBar --
megjablon 2016/06/29 17:01:52 Done.
17
18 DataReductionPromoInfoBar::DataReductionPromoInfoBar(
19 std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate)
20 : ConfirmInfoBar(std::move(delegate)) {}
21
22 DataReductionPromoInfoBar::~DataReductionPromoInfoBar() {
23 }
24
25 base::android::ScopedJavaLocalRef<jobject>
26 DataReductionPromoInfoBar::CreateRenderInfoBar(JNIEnv* env) {
27 return GetDelegate()->CreateRenderInfoBar(env);
28 }
29
30 DataReductionPromoInfoBarDelegateAndroid*
31 DataReductionPromoInfoBar::GetDelegate() {
32 return static_cast<DataReductionPromoInfoBarDelegateAndroid*>(delegate());
33 }
34
35 // DataReductionPromoInfoBarDelegate:
36
37 // static
38 std::unique_ptr<infobars::InfoBar>
39 DataReductionPromoInfoBarDelegateAndroid::CreateInfoBar(
40 infobars::InfoBarManager* infobar_manager,
41 std::unique_ptr<DataReductionPromoInfoBarDelegateAndroid> delegate) {
42 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.
43 new DataReductionPromoInfoBar(std::move(delegate)));
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698