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

Side by Side Diff: chrome/ext/background.js

Issue 6528746257383424: Issue 1708 - Integrate first-run page changes in Chrome/Opera/Safari (Closed)
Patch Set: Rebased again Created Dec. 19, 2014, 3:45 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
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 activate: function() 49 activate: function()
50 { 50 {
51 chrome.tabs.update(this._id, {selected: true}); 51 chrome.tabs.update(this._id, {selected: true});
52 }, 52 },
53 sendMessage: function(message, responseCallback) 53 sendMessage: function(message, responseCallback)
54 { 54 {
55 chrome.tabs.sendMessage(this._id, message, responseCallback); 55 chrome.tabs.sendMessage(this._id, message, responseCallback);
56 } 56 }
57 }; 57 };
58 58
59 ext._getPage = function(id)
60 {
61 return new Page({id: parseInt(id, 10)});
62 };
63
59 ext.pages = { 64 ext.pages = {
60 open: function(url, callback) 65 open: function(url, callback)
61 { 66 {
62 if (callback) 67 if (callback)
63 { 68 {
64 chrome.tabs.create({url: url}, function(openedTab) 69 chrome.tabs.create({url: url}, function(openedTab)
65 { 70 {
66 var onUpdated = function(tabId, changeInfo, tab) 71 var onUpdated = function(tabId, changeInfo, tab)
67 { 72 {
68 if (tabId == openedTab.id && changeInfo.status == "complete") 73 if (tabId == openedTab.id && changeInfo.status == "complete")
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 callback(new Page(tab)); 411 callback(new Page(tab));
407 } 412 }
408 else 413 else
409 { 414 {
410 ext.pages.open(optionsUrl, callback); 415 ext.pages.open(optionsUrl, callback);
411 } 416 }
412 }); 417 });
413 }); 418 });
414 }; 419 };
415 })(); 420 })();
OLDNEW

Powered by Google App Engine
This is Rietveld