OLD | NEW |
1 // Copyright (c) 2009 The chrome Authors. All rights reserved. | 1 // Copyright (c) 2009 The chrome Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // ----------------------------------------------------------------------------- | 5 // ----------------------------------------------------------------------------- |
6 // NOTE: If you change this file you need to touch renderer_resources.grd to | 6 // NOTE: If you change this file you need to touch renderer_resources.grd to |
7 // have your change take effect. | 7 // have your change take effect. |
8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
9 | 9 |
10 var chrome; | 10 var chrome; |
11 (function() { | 11 (function() { |
12 native function GetNextRequestId(); | 12 native function GetNextRequestId(); |
| 13 native function RegisterExtension(); |
| 14 native function UnregisterExtension(); |
| 15 native function GetViews(); |
13 native function GetWindow(); | 16 native function GetWindow(); |
14 native function GetCurrentWindow(); | 17 native function GetCurrentWindow(); |
15 native function GetLastFocusedWindow(); | 18 native function GetLastFocusedWindow(); |
16 native function CreateWindow(); | 19 native function CreateWindow(); |
17 native function UpdateWindow(); | 20 native function UpdateWindow(); |
18 native function RemoveWindow(); | 21 native function RemoveWindow(); |
19 native function GetAllWindows(); | 22 native function GetAllWindows(); |
20 native function GetTab(); | 23 native function GetTab(); |
21 native function GetSelectedTab(); | 24 native function GetSelectedTab(); |
22 native function GetAllTabsInWindow(); | 25 native function GetAllTabsInWindow(); |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 chrome.bookmarks.onBookmarkMoved = new chrome.Event("bookmark-moved"); | 495 chrome.bookmarks.onBookmarkMoved = new chrome.Event("bookmark-moved"); |
493 | 496 |
494 // Sends (id, [childrenIds]) | 497 // Sends (id, [childrenIds]) |
495 chrome.bookmarks.onBookmarkChildrenReordered = | 498 chrome.bookmarks.onBookmarkChildrenReordered = |
496 new chrome.Event("bookmark-children-reordered"); | 499 new chrome.Event("bookmark-children-reordered"); |
497 | 500 |
498 | 501 |
499 //---------------------------------------------------------------------------- | 502 //---------------------------------------------------------------------------- |
500 | 503 |
501 // Self. | 504 // Self. |
502 chrome.self = {}; | 505 chrome.self = chrome.self || {}; |
503 chrome.self.onConnect = new chrome.Event("channel-connect"); | 506 chrome.self.onConnect = new chrome.Event("channel-connect"); |
| 507 |
| 508 // Register |
| 509 chrome.self.register_ = function() { |
| 510 var extensionId = RegisterExtension(); |
| 511 window.addEventListener('unload', function() { |
| 512 UnregisterExtension(extensionId); }, false); |
| 513 delete chrome.self.register_; |
| 514 } |
| 515 |
| 516 chrome.self.getViews = function() { |
| 517 return GetViews(); |
| 518 } |
504 })(); | 519 })(); |
505 | 520 |
OLD | NEW |