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 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 is_fullscreen_ = false; |
| 219 } | 221 WebContentsDelegateAndroid::ExitFullscreenModeForTab(web_contents); |
|
Ignacio Solla
2015/01/21 14:23:04
aren't you misssing the call to
web_contents->Get
Hugo Holgersson
2015/01/21 14:26:44
Done.
| |
| 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(); | |
| 232 } | 222 } |
| 233 | 223 |
| 234 bool AwWebContentsDelegate::IsFullscreenForTabOrPending( | 224 bool AwWebContentsDelegate::IsFullscreenForTabOrPending( |
| 235 const content::WebContents* web_contents) const { | 225 const content::WebContents* web_contents) const { |
| 236 return is_fullscreen_; | 226 return is_fullscreen_; |
| 237 } | 227 } |
| 238 | 228 |
| 239 | 229 |
| 240 static void FilesSelectedInChooser( | 230 static void FilesSelectedInChooser( |
| 241 JNIEnv* env, jclass clazz, | 231 JNIEnv* env, jclass clazz, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 DVLOG(0) << "File Chooser result: mode = " << mode | 267 DVLOG(0) << "File Chooser result: mode = " << mode |
| 278 << ", file paths = " << JoinString(file_path_str, ":"); | 268 << ", file paths = " << JoinString(file_path_str, ":"); |
| 279 rvh->FilesSelectedInChooser(files, mode); | 269 rvh->FilesSelectedInChooser(files, mode); |
| 280 } | 270 } |
| 281 | 271 |
| 282 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 272 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
| 283 return RegisterNativesImpl(env); | 273 return RegisterNativesImpl(env); |
| 284 } | 274 } |
| 285 | 275 |
| 286 } // namespace android_webview | 276 } // namespace android_webview |
| OLD | NEW |