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

Side by Side Diff: android_webview/native/aw_web_contents_delegate.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: rebase 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_web_contents_delegate.h" 5 #include "android_webview/native/aw_web_contents_delegate.h"
6 6
7 #include "android_webview/browser/aw_javascript_dialog_manager.h" 7 #include "android_webview/browser/aw_javascript_dialog_manager.h"
8 #include "android_webview/browser/find_helper.h" 8 #include "android_webview/browser/find_helper.h"
9 #include "android_webview/native/aw_contents.h" 9 #include "android_webview/native/aw_contents.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 void AwWebContentsDelegate::ActivateContents(content::WebContents* contents) { 116 void AwWebContentsDelegate::ActivateContents(content::WebContents* contents) {
117 JNIEnv* env = AttachCurrentThread(); 117 JNIEnv* env = AttachCurrentThread();
118 118
119 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); 119 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env);
120 if (java_delegate.obj()) { 120 if (java_delegate.obj()) {
121 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); 121 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj());
122 } 122 }
123 } 123 }
124 124
125 void AwWebContentsDelegate::UpdatePreferredSize(
126 WebContents* web_contents,
127 const gfx::Size& pref_size) {
128 JNIEnv* env = AttachCurrentThread();
129 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
130 if (obj.is_null())
131 return;
132 return Java_AwWebContentsDelegate_updatePreferredSize(
133 env, obj.obj(), pref_size.width(), pref_size.height());
134 }
135
125 bool RegisterAwWebContentsDelegate(JNIEnv* env) { 136 bool RegisterAwWebContentsDelegate(JNIEnv* env) {
126 return RegisterNativesImpl(env); 137 return RegisterNativesImpl(env);
127 } 138 }
128 139
129 } // namespace android_webview 140 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_web_contents_delegate.h ('k') | android_webview/renderer/aw_render_view_ext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698