Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "android_webview/native/aw_contents_io_thread_client_impl.h" | 10 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 const int kFileChooserModeOpenMultiple = 1 << 0; | 40 const int kFileChooserModeOpenMultiple = 1 << 0; |
| 41 const int kFileChooserModeOpenFolder = 1 << 1; | 41 const int kFileChooserModeOpenFolder = 1 << 1; |
| 42 | 42 |
| 43 base::LazyInstance<AwJavaScriptDialogManager>::Leaky | 43 base::LazyInstance<AwJavaScriptDialogManager>::Leaky |
| 44 g_javascript_dialog_manager = LAZY_INSTANCE_INITIALIZER; | 44 g_javascript_dialog_manager = LAZY_INSTANCE_INITIALIZER; |
| 45 } | 45 } |
| 46 | 46 |
| 47 AwWebContentsDelegate::AwWebContentsDelegate( | 47 AwWebContentsDelegate::AwWebContentsDelegate( |
| 48 JNIEnv* env, | 48 JNIEnv* env, |
| 49 jobject obj) | 49 jobject obj) |
| 50 : WebContentsDelegateAndroid(env, obj) { | 50 : WebContentsDelegateAndroid(env, obj) { |
|
boliu
2014/05/27 21:45:50
initialize is_fullscreen_
qinmin
2014/05/28 17:53:39
Done.
| |
| 51 } | 51 } |
| 52 | 52 |
| 53 AwWebContentsDelegate::~AwWebContentsDelegate() { | 53 AwWebContentsDelegate::~AwWebContentsDelegate() { |
| 54 } | 54 } |
| 55 | 55 |
| 56 content::JavaScriptDialogManager* | 56 content::JavaScriptDialogManager* |
| 57 AwWebContentsDelegate::GetJavaScriptDialogManager() { | 57 AwWebContentsDelegate::GetJavaScriptDialogManager() { |
| 58 return g_javascript_dialog_manager.Pointer(); | 58 return g_javascript_dialog_manager.Pointer(); |
| 59 } | 59 } |
| 60 | 60 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 callback.Run(content::MediaStreamDevices(), | 200 callback.Run(content::MediaStreamDevices(), |
| 201 content::MEDIA_DEVICE_INVALID_STATE, | 201 content::MEDIA_DEVICE_INVALID_STATE, |
| 202 scoped_ptr<content::MediaStreamUI>().Pass()); | 202 scoped_ptr<content::MediaStreamUI>().Pass()); |
| 203 return; | 203 return; |
| 204 } | 204 } |
| 205 aw_contents->GetPermissionRequestHandler()->SendRequest( | 205 aw_contents->GetPermissionRequestHandler()->SendRequest( |
| 206 scoped_ptr<AwPermissionRequestDelegate>( | 206 scoped_ptr<AwPermissionRequestDelegate>( |
| 207 new MediaAccessPermissionRequest(request, callback))); | 207 new MediaAccessPermissionRequest(request, callback))); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void AwWebContentsDelegate::ToggleFullscreenModeForTab( | |
| 211 content::WebContents* web_contents, bool enter_fullscreen) { | |
| 212 is_fullscreen_ = enter_fullscreen; | |
| 213 web_contents->GetRenderViewHost()->WasResized(); | |
|
boliu
2014/05/27 21:45:50
So why is this needed now but not before?
Why is
qinmin
2014/05/28 17:53:39
Android webview will never get resized because it
boliu
2014/06/11 16:16:28
This API is so wrong though. The method should be
qinmin
2014/06/13 01:47:31
Ok, changed to use a separate IPC to inform the re
| |
| 214 } | |
| 215 | |
| 216 bool AwWebContentsDelegate::IsFullscreenForTabOrPending( | |
| 217 const content::WebContents* web_contents) const { | |
| 218 return is_fullscreen_; | |
| 219 } | |
| 220 | |
| 221 | |
| 210 static void FilesSelectedInChooser( | 222 static void FilesSelectedInChooser( |
| 211 JNIEnv* env, jclass clazz, | 223 JNIEnv* env, jclass clazz, |
| 212 jint process_id, jint render_id, jint mode_flags, | 224 jint process_id, jint render_id, jint mode_flags, |
| 213 jobjectArray file_paths) { | 225 jobjectArray file_paths) { |
| 214 content::RenderViewHost* rvh = content::RenderViewHost::FromID(process_id, | 226 content::RenderViewHost* rvh = content::RenderViewHost::FromID(process_id, |
| 215 render_id); | 227 render_id); |
| 216 if (!rvh) | 228 if (!rvh) |
| 217 return; | 229 return; |
| 218 | 230 |
| 219 std::vector<std::string> file_path_str; | 231 std::vector<std::string> file_path_str; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 240 DVLOG(0) << "File Chooser result: mode = " << mode | 252 DVLOG(0) << "File Chooser result: mode = " << mode |
| 241 << ", file paths = " << JoinString(file_path_str, ":"); | 253 << ", file paths = " << JoinString(file_path_str, ":"); |
| 242 rvh->FilesSelectedInChooser(files, mode); | 254 rvh->FilesSelectedInChooser(files, mode); |
| 243 } | 255 } |
| 244 | 256 |
| 245 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 257 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 246 return RegisterNativesImpl(env); | 258 return RegisterNativesImpl(env); |
| 247 } | 259 } |
| 248 | 260 |
| 249 } // namespace android_webview | 261 } // namespace android_webview |
| OLD | NEW |