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

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 862
863 } // namespace 863 } // namespace
864 864
865 void TabAndroid::SetInterceptNavigationDelegate( 865 void TabAndroid::SetInterceptNavigationDelegate(
866 JNIEnv* env, 866 JNIEnv* env,
867 const JavaParamRef<jobject>& obj, 867 const JavaParamRef<jobject>& obj,
868 const JavaParamRef<jobject>& delegate) { 868 const JavaParamRef<jobject>& delegate) {
869 DCHECK_CURRENTLY_ON(BrowserThread::UI); 869 DCHECK_CURRENTLY_ON(BrowserThread::UI);
870 InterceptNavigationDelegate::Associate( 870 InterceptNavigationDelegate::Associate(
871 web_contents(), 871 web_contents(),
872 base::WrapUnique(new ChromeInterceptNavigationDelegate(env, delegate))); 872 base::MakeUnique<ChromeInterceptNavigationDelegate>(env, delegate));
873 } 873 }
874 874
875 void TabAndroid::AttachToTabContentManager( 875 void TabAndroid::AttachToTabContentManager(
876 JNIEnv* env, 876 JNIEnv* env,
877 const JavaParamRef<jobject>& obj, 877 const JavaParamRef<jobject>& obj,
878 const JavaParamRef<jobject>& jtab_content_manager) { 878 const JavaParamRef<jobject>& jtab_content_manager) {
879 chrome::android::TabContentManager* tab_content_manager = 879 chrome::android::TabContentManager* tab_content_manager =
880 chrome::android::TabContentManager::FromJavaObject(jtab_content_manager); 880 chrome::android::TabContentManager::FromJavaObject(jtab_content_manager);
881 if (tab_content_manager == tab_content_manager_) 881 if (tab_content_manager == tab_content_manager_)
882 return; 882 return;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 918 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
919 TRACE_EVENT0("native", "TabAndroid::Init"); 919 TRACE_EVENT0("native", "TabAndroid::Init");
920 // This will automatically bind to the Java object and pass ownership there. 920 // This will automatically bind to the Java object and pass ownership there.
921 new TabAndroid(env, obj); 921 new TabAndroid(env, obj);
922 } 922 }
923 923
924 // static 924 // static
925 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 925 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
926 return RegisterNativesImpl(env); 926 return RegisterNativesImpl(env);
927 } 927 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698