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

Side by Side Diff: components/web_contents_delegate_android/web_contents_delegate_android.cc

Issue 2353063005: Refactor ContentViewClient (1/6) (Closed)
Patch Set: cast to activity Created 4 years, 2 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
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 "components/web_contents_delegate_android/web_contents_delegate_android .h" 5 #include "components/web_contents_delegate_android/web_contents_delegate_android .h"
6 6
7 #include <android/keycodes.h> 7 #include <android/keycodes.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog( 321 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog(
322 WebContents* source) { 322 WebContents* source) {
323 JNIEnv* env = AttachCurrentThread(); 323 JNIEnv* env = AttachCurrentThread();
324 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 324 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
325 if (obj.is_null()) 325 if (obj.is_null())
326 return; 326 return;
327 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj); 327 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj);
328 } 328 }
329 329
330 ScopedJavaLocalRef<jobject>
331 WebContentsDelegateAndroid::GetContentVideoViewEmbedder() {
332 JNIEnv* env = AttachCurrentThread();
333 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
334 if (obj.is_null())
335 return ScopedJavaLocalRef<jobject>();
336
337 return Java_WebContentsDelegateAndroid_getContentVideoViewEmbedder(env, obj);
338 }
339
340 bool WebContentsDelegateAndroid::ShouldBlockMediaRequest(const GURL& url) {
341 JNIEnv* env = AttachCurrentThread();
342 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
343 if (obj.is_null())
344 return false;
345 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec());
346 return Java_WebContentsDelegateAndroid_shouldBlockMediaRequest(env, obj, j_url );
347 }
348
330 void WebContentsDelegateAndroid::EnterFullscreenModeForTab( 349 void WebContentsDelegateAndroid::EnterFullscreenModeForTab(
331 WebContents* web_contents, 350 WebContents* web_contents,
332 const GURL& origin) { 351 const GURL& origin) {
333 JNIEnv* env = AttachCurrentThread(); 352 JNIEnv* env = AttachCurrentThread();
334 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 353 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
335 if (obj.is_null()) 354 if (obj.is_null())
336 return; 355 return;
337 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab(env, obj, true); 356 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab(env, obj, true);
338 } 357 }
339 358
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 validation_message_bubble_->SetPositionRelativeToAnchor( 404 validation_message_bubble_->SetPositionRelativeToAnchor(
386 rwhv->GetRenderWidgetHost(), anchor_in_root_view); 405 rwhv->GetRenderWidgetHost(), anchor_in_root_view);
387 } 406 }
388 } 407 }
389 408
390 void WebContentsDelegateAndroid::RequestAppBannerFromDevTools( 409 void WebContentsDelegateAndroid::RequestAppBannerFromDevTools(
391 content::WebContents* web_contents) { 410 content::WebContents* web_contents) {
392 } 411 }
393 412
394 } // namespace web_contents_delegate_android 413 } // namespace web_contents_delegate_android
OLDNEW
« no previous file with comments | « components/web_contents_delegate_android/web_contents_delegate_android.h ('k') | content/browser/android/content_video_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698