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

Side by Side Diff: chrome/browser/ui/android/infobars/confirm_infobar.cc

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/android/infobars/confirm_infobar.h" 5 #include "chrome/browser/ui/android/infobars/confirm_infobar.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/android/resource_mapper.h" 10 #include "chrome/browser/android/resource_mapper.h"
11 #include "components/infobars/core/confirm_infobar_delegate.h" 11 #include "components/infobars/core/confirm_infobar_delegate.h"
12 #include "jni/ConfirmInfoBarDelegate_jni.h" 12 #include "jni/ConfirmInfoBarDelegate_jni.h"
13 13
14 14
15 // ConfirmInfoBarDelegate ----------------------------------------------------- 15 // ConfirmInfoBarDelegate -----------------------------------------------------
16 16
17 // static 17 // static
18 scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( 18 scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar(
19 scoped_ptr<ConfirmInfoBarDelegate> delegate) { 19 scoped_ptr<ConfirmInfoBarDelegate> delegate) {
20 return scoped_ptr<infobars::InfoBar>(new ConfirmInfoBar(delegate.Pass())); 20 return make_scoped_ptr(new ConfirmInfoBar(delegate.Pass()));
21 } 21 }
22 22
23 23
24 // ConfirmInfoBar ------------------------------------------------------------- 24 // ConfirmInfoBar -------------------------------------------------------------
25 25
26 ConfirmInfoBar::ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate) 26 ConfirmInfoBar::ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate)
27 : InfoBarAndroid(delegate.PassAs<infobars::InfoBarDelegate>()), 27 : InfoBarAndroid(delegate.Pass()), java_confirm_delegate_() {
28 java_confirm_delegate_() {} 28 }
29 29
30 ConfirmInfoBar::~ConfirmInfoBar() { 30 ConfirmInfoBar::~ConfirmInfoBar() {
31 } 31 }
32 32
33 base::android::ScopedJavaLocalRef<jobject> ConfirmInfoBar::CreateRenderInfoBar( 33 base::android::ScopedJavaLocalRef<jobject> ConfirmInfoBar::CreateRenderInfoBar(
34 JNIEnv* env) { 34 JNIEnv* env) {
35 java_confirm_delegate_.Reset(Java_ConfirmInfoBarDelegate_create(env)); 35 java_confirm_delegate_.Reset(Java_ConfirmInfoBarDelegate_create(env));
36 base::android::ScopedJavaLocalRef<jstring> ok_button_text = 36 base::android::ScopedJavaLocalRef<jstring> ok_button_text =
37 base::android::ConvertUTF16ToJavaString( 37 base::android::ConvertUTF16ToJavaString(
38 env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_OK)); 38 env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_OK));
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return (delegate->GetButtons() & button) ? 84 return (delegate->GetButtons() & button) ?
85 delegate->GetButtonLabel(button) : base::string16(); 85 delegate->GetButtonLabel(button) : base::string16();
86 } 86 }
87 87
88 88
89 // Native JNI methods --------------------------------------------------------- 89 // Native JNI methods ---------------------------------------------------------
90 90
91 bool RegisterConfirmInfoBarDelegate(JNIEnv* env) { 91 bool RegisterConfirmInfoBarDelegate(JNIEnv* env) {
92 return RegisterNativesImpl(env); 92 return RegisterNativesImpl(env);
93 } 93 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698