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

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 12567020: [android] Resize the android_webview if it's 0x0 initially. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't re-layout while pinch-zooming Created 7 years, 8 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 "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 8 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/browser_view_renderer_impl.h" 9 #include "android_webview/browser/browser_view_renderer_impl.h"
10 #include "android_webview/browser/net_disk_cache_remover.h" 10 #include "android_webview/browser/net_disk_cache_remover.h"
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 622 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
623 if (obj.is_null()) return gfx::Point(); 623 if (obj.is_null()) return gfx::Point();
624 std::vector<int> location; 624 std::vector<int> location;
625 base::android::JavaIntArrayToIntVector( 625 base::android::JavaIntArrayToIntVector(
626 env, 626 env,
627 Java_AwContents_getLocationOnScreen(env, obj.obj()).obj(), 627 Java_AwContents_getLocationOnScreen(env, obj.obj()).obj(),
628 &location); 628 &location);
629 return gfx::Point(location[0], location[1]); 629 return gfx::Point(location[0], location[1]);
630 } 630 }
631 631
632 void AwContents::OnPageScaleFactorChanged(float page_scale_factor) {
633 JNIEnv* env = AttachCurrentThread();
634 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
635 if (obj.is_null()) return;
joth 2013/04/10 22:06:23 nit: \n before return in c++
mkosiba (inactive) 2013/04/12 16:42:19 Done.
636 Java_AwContents_onPageScaleFactorChanged(env, obj.obj(), page_scale_factor);
637 }
638
632 ScopedJavaLocalRef<jobject> AwContents::CapturePicture(JNIEnv* env, 639 ScopedJavaLocalRef<jobject> AwContents::CapturePicture(JNIEnv* env,
633 jobject obj) { 640 jobject obj) {
634 return browser_view_renderer_->CapturePicture(); 641 return browser_view_renderer_->CapturePicture();
635 } 642 }
636 643
637 void AwContents::EnableOnNewPicture(JNIEnv* env, 644 void AwContents::EnableOnNewPicture(JNIEnv* env,
638 jobject obj, 645 jobject obj,
639 jboolean enabled, 646 jboolean enabled,
640 jboolean invalidation_only) { 647 jboolean invalidation_only) {
641 BrowserViewRenderer::OnNewPictureMode mode = 648 BrowserViewRenderer::OnNewPictureMode mode =
642 BrowserViewRenderer::kOnNewPictureDisabled; 649 BrowserViewRenderer::kOnNewPictureDisabled;
643 if (enabled) { 650 if (enabled) {
644 mode = invalidation_only ? 651 mode = invalidation_only ?
645 BrowserViewRenderer::kOnNewPictureInvalidationOnly : 652 BrowserViewRenderer::kOnNewPictureInvalidationOnly :
646 BrowserViewRenderer::kOnNewPictureEnabled; 653 BrowserViewRenderer::kOnNewPictureEnabled;
647 } 654 }
648 655
649 browser_view_renderer_->EnableOnNewPicture(mode); 656 browser_view_renderer_->EnableOnNewPicture(mode);
650 } 657 }
651 658
652 } // namespace android_webview 659 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698