Bug 1360599 - [1.0] Add multiprocess setting intent extra to the GeckoView example app. r=snorp

This commit is contained in:
Eugen Sawin 2017-04-28 17:57:07 +02:00
Родитель ac8cd87072
Коммит 7d8b2ff4e0
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -13,10 +13,12 @@ import android.os.SystemClock;
import android.util.Log; import android.util.Log;
import org.mozilla.gecko.GeckoView; import org.mozilla.gecko.GeckoView;
import org.mozilla.gecko.GeckoViewSettings;
public class GeckoViewActivity extends Activity { public class GeckoViewActivity extends Activity {
private static final String LOGTAG = "GeckoViewActivity"; private static final String LOGTAG = "GeckoViewActivity";
private static final String DEFAULT_URL = "https://mozilla.org"; private static final String DEFAULT_URL = "https://mozilla.org";
private static final String USE_MULTIPROCESS_EXTRA = "use_multiprocess";
/* package */ static final int REQUEST_FILE_PICKER = 1; /* package */ static final int REQUEST_FILE_PICKER = 1;
@ -52,6 +54,10 @@ public class GeckoViewActivity extends Activity {
} }
private void loadFromIntent(final Intent intent) { private void loadFromIntent(final Intent intent) {
mGeckoView.getSettings().setBoolean(
GeckoViewSettings.USE_MULTIPROCESS,
intent.getBooleanExtra(USE_MULTIPROCESS_EXTRA, true));
final Uri uri = intent.getData(); final Uri uri = intent.getData();
mGeckoView.loadUri(uri != null ? uri.toString() : DEFAULT_URL); mGeckoView.loadUri(uri != null ? uri.toString() : DEFAULT_URL);
} }