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

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

Issue 1551033002: Convert Pass()→std::move() in //chrome (Android edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable RVO by making types match Created 4 years, 11 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
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/infobar_android.h" 5 #include "chrome/browser/ui/android/infobars/infobar_android.h"
6 6
7 #include <utility>
8
7 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
9 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
10 #include "chrome/browser/android/resource_mapper.h" 12 #include "chrome/browser/android/resource_mapper.h"
11 #include "chrome/browser/infobars/infobar_service.h" 13 #include "chrome/browser/infobars/infobar_service.h"
12 #include "components/infobars/core/infobar.h" 14 #include "components/infobars/core/infobar.h"
13 #include "components/infobars/core/infobar_delegate.h" 15 #include "components/infobars/core/infobar_delegate.h"
14 #include "jni/InfoBar_jni.h" 16 #include "jni/InfoBar_jni.h"
15 17
16 18
17 // InfoBarAndroid ------------------------------------------------------------- 19 // InfoBarAndroid -------------------------------------------------------------
18 20
19 InfoBarAndroid::InfoBarAndroid(scoped_ptr<infobars::InfoBarDelegate> delegate) 21 InfoBarAndroid::InfoBarAndroid(scoped_ptr<infobars::InfoBarDelegate> delegate)
20 : infobars::InfoBar(delegate.Pass()) { 22 : infobars::InfoBar(std::move(delegate)) {}
21 }
22 23
23 InfoBarAndroid::~InfoBarAndroid() { 24 InfoBarAndroid::~InfoBarAndroid() {
24 if (!java_info_bar_.is_null()) { 25 if (!java_info_bar_.is_null()) {
25 JNIEnv* env = base::android::AttachCurrentThread(); 26 JNIEnv* env = base::android::AttachCurrentThread();
26 Java_InfoBar_onNativeDestroyed(env, java_info_bar_.obj()); 27 Java_InfoBar_onNativeDestroyed(env, java_info_bar_.obj());
27 } 28 }
28 } 29 }
29 30
30 void InfoBarAndroid::ReassignJavaInfoBar(InfoBarAndroid* replacement) { 31 void InfoBarAndroid::ReassignJavaInfoBar(InfoBarAndroid* replacement) {
31 DCHECK(replacement); 32 DCHECK(replacement);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 int InfoBarAndroid::GetEnumeratedIconId() { 77 int InfoBarAndroid::GetEnumeratedIconId() {
77 return ResourceMapper::MapFromChromiumId(delegate()->GetIconId()); 78 return ResourceMapper::MapFromChromiumId(delegate()->GetIconId());
78 } 79 }
79 80
80 81
81 // Native JNI methods --------------------------------------------------------- 82 // Native JNI methods ---------------------------------------------------------
82 83
83 bool RegisterNativeInfoBar(JNIEnv* env) { 84 bool RegisterNativeInfoBar(JNIEnv* env) {
84 return RegisterNativesImpl(env); 85 return RegisterNativesImpl(env);
85 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698