| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 scoped_ptr<content::MediaStreamUI>().Pass()); | 203 scoped_ptr<content::MediaStreamUI>().Pass()); |
| 204 return; | 204 return; |
| 205 } | 205 } |
| 206 aw_contents->GetPermissionRequestHandler()->SendRequest( | 206 aw_contents->GetPermissionRequestHandler()->SendRequest( |
| 207 scoped_ptr<AwPermissionRequestDelegate>( | 207 scoped_ptr<AwPermissionRequestDelegate>( |
| 208 new MediaAccessPermissionRequest(request, callback))); | 208 new MediaAccessPermissionRequest(request, callback))); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void AwWebContentsDelegate::EnterFullscreenModeForTab( | 211 void AwWebContentsDelegate::EnterFullscreenModeForTab( |
| 212 content::WebContents* web_contents, const GURL& origin) { | 212 content::WebContents* web_contents, const GURL& origin) { |
| 213 ToggleFullscreenModeForTab(web_contents, true); | 213 WebContentsDelegateAndroid::EnterFullscreenModeForTab(web_contents, origin); |
| 214 is_fullscreen_ = true; |
| 215 web_contents->GetRenderViewHost()->WasResized(); |
| 214 } | 216 } |
| 215 | 217 |
| 216 void AwWebContentsDelegate::ExitFullscreenModeForTab( | 218 void AwWebContentsDelegate::ExitFullscreenModeForTab( |
| 217 content::WebContents* web_contents) { | 219 content::WebContents* web_contents) { |
| 218 ToggleFullscreenModeForTab(web_contents, false); | 220 WebContentsDelegateAndroid::ExitFullscreenModeForTab(web_contents); |
| 219 } | 221 is_fullscreen_ = false; |
| 220 | |
| 221 void AwWebContentsDelegate::ToggleFullscreenModeForTab( | |
| 222 content::WebContents* web_contents, bool enter_fullscreen) { | |
| 223 JNIEnv* env = AttachCurrentThread(); | |
| 224 | |
| 225 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); | |
| 226 if (java_delegate.obj()) { | |
| 227 Java_AwWebContentsDelegate_toggleFullscreenModeForTab( | |
| 228 env, java_delegate.obj(), enter_fullscreen); | |
| 229 } | |
| 230 is_fullscreen_ = enter_fullscreen; | |
| 231 web_contents->GetRenderViewHost()->WasResized(); | 222 web_contents->GetRenderViewHost()->WasResized(); |
| 232 } | 223 } |
| 233 | 224 |
| 234 bool AwWebContentsDelegate::IsFullscreenForTabOrPending( | 225 bool AwWebContentsDelegate::IsFullscreenForTabOrPending( |
| 235 const content::WebContents* web_contents) const { | 226 const content::WebContents* web_contents) const { |
| 236 return is_fullscreen_; | 227 return is_fullscreen_; |
| 237 } | 228 } |
| 238 | 229 |
| 239 | 230 |
| 240 static void FilesSelectedInChooser( | 231 static void FilesSelectedInChooser( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 DVLOG(0) << "File Chooser result: mode = " << mode | 268 DVLOG(0) << "File Chooser result: mode = " << mode |
| 278 << ", file paths = " << JoinString(file_path_str, ":"); | 269 << ", file paths = " << JoinString(file_path_str, ":"); |
| 279 rvh->FilesSelectedInChooser(files, mode); | 270 rvh->FilesSelectedInChooser(files, mode); |
| 280 } | 271 } |
| 281 | 272 |
| 282 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 273 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 283 return RegisterNativesImpl(env); | 274 return RegisterNativesImpl(env); |
| 284 } | 275 } |
| 285 | 276 |
| 286 } // namespace android_webview | 277 } // namespace android_webview |
| OLD | NEW |