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

Unified Diff: android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java

Issue 664243003: Make AndroidWebView shell init data reduction proxy from commandline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
diff --git a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
index 50951271fda68c41550fc18473a4030ab47b13d7..adc43fe811164d5de7eff2153cd3fcb020e058c9 100644
--- a/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
+++ b/android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java
@@ -32,10 +32,12 @@ import org.chromium.android_webview.AwBrowserContext;
import org.chromium.android_webview.AwBrowserProcess;
import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.AwContentsClient;
+import org.chromium.android_webview.AwContentsStatics;
import org.chromium.android_webview.AwDevToolsServer;
import org.chromium.android_webview.AwSettings;
import org.chromium.android_webview.test.AwTestContainerView;
import org.chromium.android_webview.test.NullContentsClient;
+import org.chromium.base.CommandLine;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.NavigationController;
import org.chromium.content_public.browser.WebContents;
@@ -55,6 +57,11 @@ public class AwShellActivity extends Activity {
private ImageButton mPrevButton;
private ImageButton mNextButton;
+ // This is the same as data_reduction_proxy::switches::kEnableDataReductionProxy.
+ private static final String ENABLE_DATA_REDUCTION_PROXY = "enable-spdy-proxy-auth";
+ // This is the same as data_reduction_proxy::switches::kDataReductionProxyKey.
+ private static final String DATA_REDUCTION_PROXY_KEY = "spdy-proxy-auth-value";
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -82,6 +89,14 @@ public class AwShellActivity extends Activity {
mAwTestContainerView.getAwContents().loadUrl(new LoadUrlParams(startupUrl));
AwContents.setShouldDownloadFavicons();
mUrlTextView.setText(startupUrl);
+
+ if (CommandLine.getInstance().hasSwitch(ENABLE_DATA_REDUCTION_PROXY)) {
+ String key = CommandLine.getInstance().getSwitchValue(DATA_REDUCTION_PROXY_KEY);
+ if (key != null && !key.isEmpty()) {
+ AwContentsStatics.setDataReductionProxyKey(key);
+ AwContentsStatics.setDataReductionProxyEnabled(true);
+ }
+ }
}
private AwTestContainerView createAwTestContainerView() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698