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

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

Issue 5981059543990272: Issue 1820 - Fixed issue where multiple tabs were highlghited (Closed)
Patch Set: Created Jan. 16, 2015, 12:28 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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 30 matching lines...) Expand all
41 var frames = framesOfTabs[this._id]; 41 var frames = framesOfTabs[this._id];
42 if (frames) 42 if (frames)
43 { 43 {
44 var frame = frames[0]; 44 var frame = frames[0];
45 if (frame) 45 if (frame)
46 return frame.url; 46 return frame.url;
47 } 47 }
48 }, 48 },
49 activate: function() 49 activate: function()
50 { 50 {
51 chrome.tabs.update(this._id, {highlighted: true}); 51 chrome.tabs.get(this._id, function(tab)
52 {
53 chrome.tabs.highlight(
54 {
55 windowId: tab.windowId,
56 tabs: [tab.index]
Wladimir Palant 2015/01/16 15:59:17 I wonder why they created an API that works with t
57 },
58 function() {}
59 );
60 });
52 }, 61 },
53 sendMessage: function(message, responseCallback) 62 sendMessage: function(message, responseCallback)
54 { 63 {
55 chrome.tabs.sendMessage(this._id, message, responseCallback); 64 chrome.tabs.sendMessage(this._id, message, responseCallback);
56 } 65 }
57 }; 66 };
58 67
59 ext._getPage = function(id) 68 ext._getPage = function(id)
60 { 69 {
61 return new Page({id: parseInt(id, 10)}); 70 return new Page({id: parseInt(id, 10)});
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 if (!win.incognito) 425 if (!win.incognito)
417 queryInfo.windowId = win.id; 426 queryInfo.windowId = win.id;
418 427
419 chrome.tabs.query(queryInfo, function(tabs) 428 chrome.tabs.query(queryInfo, function(tabs)
420 { 429 {
421 if (tabs.length > 0) 430 if (tabs.length > 0)
422 { 431 {
423 var tab = tabs[0]; 432 var tab = tabs[0];
424 433
425 chrome.windows.update(tab.windowId, {focused: true}); 434 chrome.windows.update(tab.windowId, {focused: true});
426 chrome.tabs.update(tab.id, {highlighted: true}); 435 chrome.tabs.highlight(
436 {
437 windowId: tab.windowId,
438 tabs: [tab.index]
439 },
440 function() {}
441 );
427 442
428 if (callback) 443 if (callback)
429 callback(new Page(tab)); 444 callback(new Page(tab));
430 } 445 }
431 else 446 else
432 { 447 {
433 ext.pages.open(optionsUrl, callback); 448 ext.pages.open(optionsUrl, callback);
434 } 449 }
435 }); 450 });
436 }); 451 });
437 }; 452 };
438 })(); 453 })();
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