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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 11568042: Some initial changes for manipulating the top controls positions on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added additional flag that will be needed by the cc layer. Created 8 years 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 "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 void ContentViewCoreImpl::UpdatePageScaleLimits(float minimum_scale, 409 void ContentViewCoreImpl::UpdatePageScaleLimits(float minimum_scale,
410 float maximum_scale) { 410 float maximum_scale) {
411 JNIEnv* env = AttachCurrentThread(); 411 JNIEnv* env = AttachCurrentThread();
412 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 412 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
413 if (obj.is_null()) 413 if (obj.is_null())
414 return; 414 return;
415 Java_ContentViewCore_updatePageScaleLimits(env, obj.obj(), minimum_scale, 415 Java_ContentViewCore_updatePageScaleLimits(env, obj.obj(), minimum_scale,
416 maximum_scale); 416 maximum_scale);
417 } 417 }
418 418
419 void ContentViewCoreImpl::UpdateOffsetsForFullscreen(float controls_offset,
420 float content_offset) {
421 JNIEnv* env = AttachCurrentThread();
422 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
423 if (obj.is_null())
424 return;
425 Java_ContentViewCore_updateOffsetsForFullscreen(env, obj.obj(),
426 controls_offset,
427 content_offset);
428 }
429
419 void ContentViewCoreImpl::SetTitle(const string16& title) { 430 void ContentViewCoreImpl::SetTitle(const string16& title) {
420 JNIEnv* env = AttachCurrentThread(); 431 JNIEnv* env = AttachCurrentThread();
421 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 432 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
422 if (obj.is_null()) 433 if (obj.is_null())
423 return; 434 return;
424 ScopedJavaLocalRef<jstring> jtitle = 435 ScopedJavaLocalRef<jstring> jtitle =
425 ConvertUTF8ToJavaString(env, UTF16ToUTF8(title)); 436 ConvertUTF8ToJavaString(env, UTF16ToUTF8(title));
426 Java_ContentViewCore_setTitle(env, obj.obj(), jtitle.obj()); 437 Java_ContentViewCore_setTitle(env, obj.obj(), jtitle.obj());
427 } 438 }
428 439
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { 1293 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) {
1283 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; 1294 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!";
1284 return false; 1295 return false;
1285 } 1296 }
1286 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); 1297 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I");
1287 1298
1288 return RegisterNativesImpl(env) >= 0; 1299 return RegisterNativesImpl(env) >= 0;
1289 } 1300 }
1290 1301
1291 } // namespace content 1302 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698