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

Side by Side Diff: lib/ui.js

Issue 5705421486555136: First run page and subscription on install fix (FF for android) (Closed)
Patch Set: Created April 25, 2014, 11:40 a.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 <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 15 matching lines...) Expand all
26 let {FilterNotifier} = require("filterNotifier"); 26 let {FilterNotifier} = require("filterNotifier");
27 let {RequestNotifier} = require("requestNotifier"); 27 let {RequestNotifier} = require("requestNotifier");
28 let {Filter} = require("filterClasses"); 28 let {Filter} = require("filterClasses");
29 let {Subscription, SpecialSubscription, DownloadableSubscription} = require("sub scriptionClasses"); 29 let {Subscription, SpecialSubscription, DownloadableSubscription} = require("sub scriptionClasses");
30 let {Synchronizer} = require("synchronizer"); 30 let {Synchronizer} = require("synchronizer");
31 let {KeySelector} = require("keySelector"); 31 let {KeySelector} = require("keySelector");
32 let {Notification} = require("notification"); 32 let {Notification} = require("notification");
33 let {initAntiAdblockNotification} = require("antiadblockInit"); 33 let {initAntiAdblockNotification} = require("antiadblockInit");
34 34
35 let CustomizableUI; 35 let CustomizableUI;
36 try
37 {
38 ({CustomizableUI}) = Cu.import("resource:///modules/CustomizableUI.jsm", null) ;
39 }
40 catch (e)
41 {
42 // No built-in CustomizableUI API, use our own implementation.
43 ({CustomizableUI}) = require("customizableUI");
44 }
45 36
46 /** 37 /**
47 * Filter corresponding with "disable on site" menu item (set in fillIconMent()) . 38 * Filter corresponding with "disable on site" menu item (set in fillIconMent()) .
48 * @type Filter 39 * @type Filter
49 */ 40 */
50 let siteWhitelist = null; 41 let siteWhitelist = null;
51 /** 42 /**
52 * Filter corresponding with "disable on site" menu item (set in fillIconMenu()) . 43 * Filter corresponding with "disable on site" menu item (set in fillIconMenu()) .
53 * @type Filter 44 * @type Filter
54 */ 45 */
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 */ 261 */
271 let notificationTimer = null; 262 let notificationTimer = null;
272 263
273 let UI = exports.UI = 264 let UI = exports.UI =
274 { 265 {
275 /** 266 /**
276 * Gets called on startup, initializes UI integration. 267 * Gets called on startup, initializes UI integration.
277 */ 268 */
278 init: function() 269 init: function()
279 { 270 {
271 try
272 {
273 ({CustomizableUI}) = Cu.import("resource:///modules/CustomizableUI.jsm", n ull);
saroyanm 2014/04/25 12:08:06 Not sure if we need this here ?
274 }
275 catch (e)
276 {
277 // No built-in CustomizableUI API, use our own implementation.
278 ({CustomizableUI}) = require("customizableUI");
279 }
Wladimir Palant 2014/04/25 12:39:54 This doesn't resolve the circular reference. The m
saroyanm 2014/04/25 14:04:22 Thanks for descriptive comment. Done.
280
280 // We should call initDone once both overlay and filters are loaded 281 // We should call initDone once both overlay and filters are loaded
281 let overlayLoaded = false; 282 let overlayLoaded = false;
282 let filtersLoaded = false; 283 let filtersLoaded = false;
283 let sessionRestored = false; 284 let sessionRestored = false;
284 285
285 // Start loading overlay 286 // Start loading overlay
286 let request = new XMLHttpRequest(); 287 let request = new XMLHttpRequest();
287 request.mozBackgroundRequest = true; 288 request.mozBackgroundRequest = true;
288 request.open("GET", "chrome://adblockplus/content/ui/overlay.xul"); 289 request.open("GET", "chrome://adblockplus/content/ui/overlay.xul");
289 request.addEventListener("load", function(event) 290 request.addEventListener("load", function(event)
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1913 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1913 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1914 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1914 ]; 1915 ];
1915 1916
1916 onShutdown.add(function() 1917 onShutdown.add(function()
1917 { 1918 {
1918 for (let window in UI.applicationWindows) 1919 for (let window in UI.applicationWindows)
1919 if (UI.isBottombarOpen(window)) 1920 if (UI.isBottombarOpen(window))
1920 UI.toggleBottombar(window); 1921 UI.toggleBottombar(window);
1921 }); 1922 });
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