Handle content:// URLs in View Source. https://redmine.stoutner.com/issues/361
[PrivacyBrowser.git] / app / src / main / java / com / stoutner / privacybrowser / viewmodelfactories / WebViewSourceFactory.kt
index 870e784e638cbdeddef5106d6d50481bbe86ca51..e44e74d81847d2d2be16f4741249459fbd9c5751 100644 (file)
 
 package com.stoutner.privacybrowser.viewmodelfactories
 
+import android.content.ContentResolver
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.ViewModelProvider
 
 import java.net.Proxy
 import java.util.concurrent.ExecutorService
 
-class WebViewSourceFactory (private val urlString: String, private val userAgent: String, private val localeString: String, private val proxy: Proxy,
+class WebViewSourceFactory (private val urlString: String, private val userAgent: String, private val localeString: String, private val proxy: Proxy, private val contentResolver: ContentResolver,
                             private val executorService: ExecutorService): ViewModelProvider.Factory {
     // Override the create function in order to add the provided arguments.
     override fun <T: ViewModel?> create(modelClass: Class<T>): T {
         // Return a new instance of the model class with the provided arguments.
-        return modelClass.getConstructor(String::class.java, String::class.java, Boolean::class.java, String::class.java, Proxy::class.java, ExecutorService::class.java)
-                .newInstance(urlString, userAgent, localeString, proxy, executorService)
+        return modelClass.getConstructor(String::class.java, String::class.java, String::class.java, Proxy::class.java, ContentResolver::class.java, ExecutorService::class.java)
+                .newInstance(urlString, userAgent, localeString, proxy, contentResolver, executorService)
     }
 }
\ No newline at end of file