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

Delta Between Two Patch Sets: src/org/adblockplus/android/AdblockPlus.java

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Left Patch Set: Addressed new review issues Created April 28, 2014, 8:34 a.m.
Right Patch Set: Even more review issues fixed. Created April 28, 2014, 10:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/org/adblockplus/android/AboutDialog.java ('k') | src/org/adblockplus/android/AdvancedPreferences.java » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 */ 325 */
326 public String[] getSelectorsForDomain(final String domain) 326 public String[] getSelectorsForDomain(final String domain)
327 { 327 {
328 /* We need to ignore element hiding rules here to work around two bugs: 328 /* We need to ignore element hiding rules here to work around two bugs:
329 * 1. CSS is being injected even when there's an exception rule with $elemhi de 329 * 1. CSS is being injected even when there's an exception rule with $elemhi de
330 * 2. The injected CSS causes blank pages in Chrome for Android 330 * 2. The injected CSS causes blank pages in Chrome for Android
331 * 331 *
332 * Starting with 1.1.2, we ignored element hiding rules after download anywa y, to keep the 332 * Starting with 1.1.2, we ignored element hiding rules after download anywa y, to keep the
333 * memory usage down. Doing this with libadblockplus is trickier, but would be the clean 333 * memory usage down. Doing this with libadblockplus is trickier, but would be the clean
334 * solution. */ 334 * solution. */
335
336 return null; 335 return null;
337 /* 336 /*
338 if (!filteringEnabled) 337 if (!filteringEnabled)
339 return null; 338 return null;
340 339
341 return abpEngine.getSelectorsForDomain(domain); 340 return abpEngine.getSelectorsForDomain(domain);
342 */ 341 */
343 } 342 }
344 343
345 /** 344 /**
346 * Checks if filters match request parameters. 345 * Checks if filters match request parameters.
347 * 346 *
348 * @param url 347 * @param url
349 * Request URL 348 * Request URL
350 * @param query 349 * @param query
351 * Request query string 350 * Request query string
352 * @param referrer 351 * @param referrer
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 /** 423 /**
425 * Enables or disables filtering. 424 * Enables or disables filtering.
426 */ 425 */
427 public void setFilteringEnabled(final boolean enable) 426 public void setFilteringEnabled(final boolean enable)
428 { 427 {
429 filteringEnabled = enable; 428 filteringEnabled = enable;
430 sendBroadcast(new Intent(BROADCAST_FILTERING_CHANGE).putExtra("enabled", fil teringEnabled)); 429 sendBroadcast(new Intent(BROADCAST_FILTERING_CHANGE).putExtra("enabled", fil teringEnabled));
431 } 430 }
432 431
433 /** 432 /**
434 * Starts ABP engine. It also initiates subscription refresh if it is enabled in user settings. 433 * Starts ABP engine. It also initiates subscription refresh if it is enabled
434 * in user settings.
435 */ 435 */
436 public void startEngine() 436 public void startEngine()
437 { 437 {
438 if (abpEngine == null) 438 if (abpEngine == null)
439 { 439 {
440 final File basePath = getFilesDir(); 440 final File basePath = getFilesDir();
441 abpEngine = ABPEngine.create(AdblockPlus.getApplication(), ABPEngine.gener ateAppInfo(this), basePath.getAbsolutePath()); 441 abpEngine = ABPEngine.create(AdblockPlus.getApplication(), ABPEngine.gener ateAppInfo(this), basePath.getAbsolutePath());
442 } 442 }
443 } 443 }
444 444
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 Log.e(TAG, e.getMessage(), e); 536 Log.e(TAG, e.getMessage(), e);
537 } 537 }
538 538
539 // Set crash handler 539 // Set crash handler
540 Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(this)); 540 Thread.setDefaultUncaughtExceptionHandler(new CrashHandler(this));
541 541
542 // Initiate update check 542 // Initiate update check
543 scheduleUpdater(0); 543 scheduleUpdater(0);
544 } 544 }
545 } 545 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld