| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/android/tab_android.h" | 5 #include "chrome/browser/android/tab_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 const base::android::JavaParamRef<jobject>& obj, | 725 const base::android::JavaParamRef<jobject>& obj, |
| 726 jboolean enabled) { | 726 jboolean enabled) { |
| 727 embedded_media_experience_enabled_ = enabled; | 727 embedded_media_experience_enabled_ = enabled; |
| 728 | 728 |
| 729 if (!web_contents() || !web_contents()->GetRenderViewHost()) | 729 if (!web_contents() || !web_contents()->GetRenderViewHost()) |
| 730 return; | 730 return; |
| 731 | 731 |
| 732 web_contents()->GetRenderViewHost()->OnWebkitPreferencesChanged(); | 732 web_contents()->GetRenderViewHost()->OnWebkitPreferencesChanged(); |
| 733 } | 733 } |
| 734 | 734 |
| 735 jboolean TabAndroid::GetEmbeddedMediaExperienceEnabled( |
| 736 JNIEnv* env, |
| 737 const base::android::JavaParamRef<jobject>& obj) { |
| 738 return embedded_media_experience_enabled_; |
| 739 } |
| 740 |
| 735 bool TabAndroid::ShouldEnableEmbeddedMediaExperience() const { | 741 bool TabAndroid::ShouldEnableEmbeddedMediaExperience() const { |
| 736 return embedded_media_experience_enabled_; | 742 return embedded_media_experience_enabled_; |
| 737 } | 743 } |
| 738 | 744 |
| 739 namespace { | 745 namespace { |
| 740 | 746 |
| 741 class ChromeInterceptNavigationDelegate : public InterceptNavigationDelegate { | 747 class ChromeInterceptNavigationDelegate : public InterceptNavigationDelegate { |
| 742 public: | 748 public: |
| 743 ChromeInterceptNavigationDelegate(JNIEnv* env, jobject jdelegate) | 749 ChromeInterceptNavigationDelegate(JNIEnv* env, jobject jdelegate) |
| 744 : InterceptNavigationDelegate(env, jdelegate) {} | 750 : InterceptNavigationDelegate(env, jdelegate) {} |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 801 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 796 TRACE_EVENT0("native", "TabAndroid::Init"); | 802 TRACE_EVENT0("native", "TabAndroid::Init"); |
| 797 // This will automatically bind to the Java object and pass ownership there. | 803 // This will automatically bind to the Java object and pass ownership there. |
| 798 new TabAndroid(env, obj); | 804 new TabAndroid(env, obj); |
| 799 } | 805 } |
| 800 | 806 |
| 801 // static | 807 // static |
| 802 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 808 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
| 803 return RegisterNativesImpl(env); | 809 return RegisterNativesImpl(env); |
| 804 } | 810 } |
| OLD | NEW |