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

Unified Diff: mobile/android/base/BrowserApp.java

Issue 5365916275572736: Issue 2351 - Add a custom menu item for whitelisting the current site (Closed)
Patch Set: Minimally invasive approach Created May 6, 2015, 12:12 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mobile/android/base/BrowserApp.java
===================================================================
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -253,6 +253,9 @@
case SELECTED:
if (Tabs.getInstance().isSelectedTab(tab)) {
updateHomePagerForTab(tab);
+ if (mMenu != null)
+ org.adblockplus.browser.BrowserAppUtils.updateBlockAdsMenuItem(
+ mMenu.findItem(R.id.block_ads));
}
break;
case START:
@@ -2281,6 +2284,12 @@
* the root (mMenu).
*/
private void addAddonMenuItemToMenu(final Menu menu, final MenuItemInfo info) {
+ // Adblock Browser doesn't support add-ons, so the only menu item that
+ // could be added is the one for whitelisting the current domain added
+ // by ABP - Adblock Browser has its own item for that.
+ if (true)
+ return;
+
info.added = true;
final Menu destination;
@@ -2441,6 +2450,9 @@
share.setActionProvider(provider);
}
+ org.adblockplus.browser.BrowserAppUtils.updateBlockAdsMenuItem(
+ mMenu.findItem(R.id.block_ads));
+
return true;
}
@@ -2783,6 +2795,11 @@
return true;
}
+ if (itemId == R.id.block_ads) {
+ org.adblockplus.browser.BrowserAppUtils.updateCurrentTabWhitelisting(item);
+ return true;
+ }
+
if (itemId == R.id.new_tab) {
addTab();
return true;

Powered by Google App Engine
This is Rietveld