| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bottombar/overlay_panel_content.h" | 5 #include "chrome/browser/android/bottombar/overlay_panel_content.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void OverlayPanelContent::SetInterceptNavigationDelegate( | 123 void OverlayPanelContent::SetInterceptNavigationDelegate( |
| 124 JNIEnv* env, | 124 JNIEnv* env, |
| 125 const JavaParamRef<jobject>& obj, | 125 const JavaParamRef<jobject>& obj, |
| 126 const JavaParamRef<jobject>& delegate, | 126 const JavaParamRef<jobject>& delegate, |
| 127 const JavaParamRef<jobject>& jweb_contents) { | 127 const JavaParamRef<jobject>& jweb_contents) { |
| 128 content::WebContents* web_contents = | 128 content::WebContents* web_contents = |
| 129 content::WebContents::FromJavaWebContents(jweb_contents); | 129 content::WebContents::FromJavaWebContents(jweb_contents); |
| 130 DCHECK(web_contents); | 130 DCHECK(web_contents); |
| 131 navigation_interception::InterceptNavigationDelegate::Associate( | 131 navigation_interception::InterceptNavigationDelegate::Associate( |
| 132 web_contents, | 132 web_contents, |
| 133 base::WrapUnique(new navigation_interception::InterceptNavigationDelegate( | 133 base::MakeUnique<navigation_interception::InterceptNavigationDelegate>( |
| 134 env, delegate))); | 134 env, delegate)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool RegisterOverlayPanelContent(JNIEnv* env) { | 137 bool RegisterOverlayPanelContent(JNIEnv* env) { |
| 138 return RegisterNativesImpl(env); | 138 return RegisterNativesImpl(env); |
| 139 } | 139 } |
| 140 | 140 |
| 141 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 141 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 142 OverlayPanelContent* content = new OverlayPanelContent(env, obj); | 142 OverlayPanelContent* content = new OverlayPanelContent(env, obj); |
| 143 return reinterpret_cast<intptr_t>(content); | 143 return reinterpret_cast<intptr_t>(content); |
| 144 } | 144 } |
| OLD | NEW |