Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: chrome/test/data/extensions/samples/password_maker/toolstrip.html

Issue 179027: Make a bunch of backlogged breaking changes to the extensions (Closed)
Patch Set: Put chrome.self back Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <script> 1 <script>
2 var windowId = null; // the browser window this toolstrip is in 2 var windowId = null; // the browser window this toolstrip is in
3 var currentPort = null; // the port of the currently focused tab 3 var currentPort = null; // the port of the currently focused tab
4 4
5 chrome.windows.getCurrent(function(win) { 5 chrome.windows.getCurrent(function(win) {
6 // I think this is guaranteed to be called before our onConnect handler, 6 // I think this is guaranteed to be called before our onConnect handler,
7 // because we asked for it first. 7 // because we asked for it first.
8 windowId = win.id; 8 windowId = win.id;
9 }); 9 });
10 10
11 chrome.self.onConnect.addListener(function (port) { 11 chrome.extension.onConnect.addListener(function (port) {
12 if (port.tab.windowId != windowId) 12 if (port.tab.windowId != windowId)
13 return; 13 return;
14 port.onMessage.addListener(function (msg, port) { 14 port.onMessage.addListener(function (msg, port) {
15 if (msg.queryPassword) { 15 if (msg.queryPassword) {
16 // A page is requesting a site password. 16 // A page is requesting a site password.
17 openDialog(port); 17 openDialog(port);
18 } else if (typeof(msg.canQueryPassword) != "undefined") { 18 } else if (typeof(msg.canQueryPassword) != "undefined") {
19 currentPort = port; 19 currentPort = port;
20 setHasPassword(msg.canQueryPassword); 20 setHasPassword(msg.canQueryPassword);
21 } 21 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 </script> 62 </script>
63 63
64 <body> 64 <body>
65 <div class="toolstrip-button" onclick="onClick()"> 65 <div class="toolstrip-button" onclick="onClick()">
66 <img src="favicon.ico"> 66 <img src="favicon.ico">
67 <span id="hasPassword" style="display:none;">Fill Password</span> 67 <span id="hasPassword" style="display:none;">Fill Password</span>
68 <span id="notHasPassword">PasswordMaker</span> 68 <span id="notHasPassword">PasswordMaker</span>
69 </div> 69 </div>
70 </body> 70 </body>
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/samples/getviews/common.js ('k') | chrome/test/data/extensions/samples/screenshot/screenshot.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698