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

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 2640143002: Allow autoplay unmuted for WebAPK in the manifest scope (Closed)
Patch Set: addressed nits Created 3 years, 10 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
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 void TabAndroid::SetInterceptNavigationDelegate( 738 void TabAndroid::SetInterceptNavigationDelegate(
739 JNIEnv* env, 739 JNIEnv* env,
740 const JavaParamRef<jobject>& obj, 740 const JavaParamRef<jobject>& obj,
741 const JavaParamRef<jobject>& delegate) { 741 const JavaParamRef<jobject>& delegate) {
742 DCHECK_CURRENTLY_ON(BrowserThread::UI); 742 DCHECK_CURRENTLY_ON(BrowserThread::UI);
743 InterceptNavigationDelegate::Associate( 743 InterceptNavigationDelegate::Associate(
744 web_contents(), 744 web_contents(),
745 base::MakeUnique<ChromeInterceptNavigationDelegate>(env, delegate)); 745 base::MakeUnique<ChromeInterceptNavigationDelegate>(env, delegate));
746 } 746 }
747 747
748 void TabAndroid::SetWebappManifestScope(JNIEnv* env,
749 const JavaParamRef<jobject>& obj,
750 const JavaParamRef<jstring>& scope) {
751 webapp_manifest_scope_ = base::android::ConvertJavaStringToUTF8(scope);
752
753 if (!web_contents() || !web_contents()->GetRenderViewHost())
754 return;
755
756 web_contents()->GetRenderViewHost()->OnWebkitPreferencesChanged();
757 }
758
748 void TabAndroid::AttachToTabContentManager( 759 void TabAndroid::AttachToTabContentManager(
749 JNIEnv* env, 760 JNIEnv* env,
750 const JavaParamRef<jobject>& obj, 761 const JavaParamRef<jobject>& obj,
751 const JavaParamRef<jobject>& jtab_content_manager) { 762 const JavaParamRef<jobject>& jtab_content_manager) {
752 android::TabContentManager* tab_content_manager = 763 android::TabContentManager* tab_content_manager =
753 android::TabContentManager::FromJavaObject(jtab_content_manager); 764 android::TabContentManager::FromJavaObject(jtab_content_manager);
754 if (tab_content_manager == tab_content_manager_) 765 if (tab_content_manager == tab_content_manager_)
755 return; 766 return;
756 767
757 if (tab_content_manager_) 768 if (tab_content_manager_)
758 tab_content_manager_->DetachLiveLayer(GetAndroidId(), GetContentLayer()); 769 tab_content_manager_->DetachLiveLayer(GetAndroidId(), GetContentLayer());
759 tab_content_manager_ = tab_content_manager; 770 tab_content_manager_ = tab_content_manager;
760 if (tab_content_manager_) 771 if (tab_content_manager_)
761 tab_content_manager_->AttachLiveLayer(GetAndroidId(), GetContentLayer()); 772 tab_content_manager_->AttachLiveLayer(GetAndroidId(), GetContentLayer());
762 } 773 }
763 774
764 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 775 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
765 TRACE_EVENT0("native", "TabAndroid::Init"); 776 TRACE_EVENT0("native", "TabAndroid::Init");
766 // This will automatically bind to the Java object and pass ownership there. 777 // This will automatically bind to the Java object and pass ownership there.
767 new TabAndroid(env, obj); 778 new TabAndroid(env, obj);
768 } 779 }
769 780
770 // static 781 // static
771 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 782 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
772 return RegisterNativesImpl(env); 783 return RegisterNativesImpl(env);
773 } 784 }
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698