Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/MainActivity.java

Issue 29555716: Issue 5770 - Allow WebView debugging (Closed)
Patch Set: Created Sept. 25, 2017, 12:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 private AdblockWebView webView; 53 private AdblockWebView webView;
54 54
55 @Override 55 @Override
56 protected void onCreate(Bundle savedInstanceState) 56 protected void onCreate(Bundle savedInstanceState)
57 { 57 {
58 super.onCreate(savedInstanceState); 58 super.onCreate(savedInstanceState);
59 setContentView(R.layout.activity_main); 59 setContentView(R.layout.activity_main);
60 60
61 bindControls(); 61 bindControls();
62 initControls(); 62 initControls();
63
64 // allow WebView debugging in "Debug" build variant
65 // https://developers.google.com/web/tools/chrome-devtools/remote-debugging/ webviews
66 if (BuildConfig.DEBUG)
67 {
68 WebView.setWebContentsDebuggingEnabled(true);
69 }
63 } 70 }
64 71
65 private void bindControls() 72 private void bindControls()
66 { 73 {
67 url = (EditText) findViewById(R.id.main_url); 74 url = (EditText) findViewById(R.id.main_url);
68 ok = (Button) findViewById(R.id.main_ok); 75 ok = (Button) findViewById(R.id.main_ok);
69 back = (Button) findViewById(R.id.main_back); 76 back = (Button) findViewById(R.id.main_back);
70 forward = (Button) findViewById(R.id.main_forward); 77 forward = (Button) findViewById(R.id.main_forward);
71 settings = (Button) findViewById(R.id.main_settings); 78 settings = (Button) findViewById(R.id.main_settings);
72 progress = (ProgressBar) findViewById(R.id.main_progress); 79 progress = (ProgressBar) findViewById(R.id.main_progress);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 if (USE_EXTERNAL_ADBLOCKENGINE) 272 if (USE_EXTERNAL_ADBLOCKENGINE)
266 { 273 {
267 AdblockHelper.get().release(); 274 AdblockHelper.get().release();
268 } 275 }
269 } 276 }
270 }); 277 });
271 278
272 super.onDestroy(); 279 super.onDestroy();
273 } 280 }
274 } 281 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld