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

Side by Side Diff: components/web_contents_delegate_android/web_contents_delegate_android.cc

Issue 11967015: Hide location bar on WebKit programmatic scroll. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Route requestHideTopControls through browser. Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "components/web_contents_delegate_android/web_contents_delegate_android .h" 5 #include "components/web_contents_delegate_android/web_contents_delegate_android .h"
6 6
7 #include <android/keycodes.h> 7 #include <android/keycodes.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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending( 293 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending(
294 const WebContents* web_contents) const { 294 const WebContents* web_contents) const {
295 JNIEnv* env = AttachCurrentThread(); 295 JNIEnv* env = AttachCurrentThread();
296 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 296 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
297 if (obj.is_null()) 297 if (obj.is_null())
298 return false; 298 return false;
299 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending( 299 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending(
300 env, obj.obj()); 300 env, obj.obj());
301 } 301 }
302 302
303 void WebContentsDelegateAndroid::RequestShowTopControls(
304 WebContents* web_contents, bool show) {
305 JNIEnv* env = AttachCurrentThread();
306 ScopedJavaLocalRef<jobject> content_view_core =
307 content::ContentViewCore::FromWebContents(web_contents)->GetJavaObject();
308 if (content_view_core.is_null())
309 return;
310 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
311 if (obj.is_null())
312 return;
313 Java_WebContentsDelegateAndroid_requestShowTopControls(
314 env, obj.obj(), content_view_core.obj(), show);
315 }
316
317
303 // ---------------------------------------------------------------------------- 318 // ----------------------------------------------------------------------------
304 // Native JNI methods 319 // Native JNI methods
305 // ---------------------------------------------------------------------------- 320 // ----------------------------------------------------------------------------
306 321
307 // Register native methods 322 // Register native methods
308 323
309 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { 324 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) {
310 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { 325 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) {
311 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; 326 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!";
312 return false; 327 return false;
313 } 328 }
314 return RegisterNativesImpl(env); 329 return RegisterNativesImpl(env);
315 } 330 }
316 331
317 } // namespace components 332 } // namespace components
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698