| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium 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 // This script contains privileged chrome extension related javascript APIs. | 5 // This script contains privileged chrome extension related javascript APIs. |
| 6 // It is loaded by pages whose URL has the chrome-extension protocol. | 6 // It is loaded by pages whose URL has the chrome-extension protocol. |
| 7 | 7 |
| 8 var chrome = chrome || {}; | 8 var chrome = chrome || {}; |
| 9 (function() { | 9 (function() { |
| 10 native function GetChromeHidden(); | 10 native function GetChromeHidden(); |
| (...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 apiFunctions.setHandleRequest("browserAction.setIcon", function(details) { | 1017 apiFunctions.setHandleRequest("browserAction.setIcon", function(details) { |
| 1018 setExtensionActionIconCommon( | 1018 setExtensionActionIconCommon( |
| 1019 details, this.name, this.definition.parameters, "browser action"); | 1019 details, this.name, this.definition.parameters, "browser action"); |
| 1020 }); | 1020 }); |
| 1021 | 1021 |
| 1022 apiFunctions.setHandleRequest("pageAction.setIcon", function(details) { | 1022 apiFunctions.setHandleRequest("pageAction.setIcon", function(details) { |
| 1023 setExtensionActionIconCommon( | 1023 setExtensionActionIconCommon( |
| 1024 details, this.name, this.definition.parameters, "page action"); | 1024 details, this.name, this.definition.parameters, "page action"); |
| 1025 }); | 1025 }); |
| 1026 | 1026 |
| 1027 apiFunctions.setHandleRequest("experimental.sidebar.setIcon", | |
| 1028 function(details) { | |
| 1029 var SIDEBAR_ICON_SIZE = 16; | |
| 1030 setIconCommon( | |
| 1031 details, this.name, this.definition.parameters, "sidebar", | |
| 1032 SIDEBAR_ICON_SIZE, SetIconCommon); | |
| 1033 }); | |
| 1034 | |
| 1035 apiFunctions.setHandleRequest("contextMenus.create", | 1027 apiFunctions.setHandleRequest("contextMenus.create", |
| 1036 function() { | 1028 function() { |
| 1037 var args = arguments; | 1029 var args = arguments; |
| 1038 var id = GetNextContextMenuId(); | 1030 var id = GetNextContextMenuId(); |
| 1039 args[0].generatedId = id; | 1031 args[0].generatedId = id; |
| 1040 sendRequest(this.name, args, this.definition.parameters, | 1032 sendRequest(this.name, args, this.definition.parameters, |
| 1041 {customCallback: this.customCallback}); | 1033 {customCallback: this.customCallback}); |
| 1042 return id; | 1034 return id; |
| 1043 }); | 1035 }); |
| 1044 | 1036 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 if (apiExists("pageActions")) | 1231 if (apiExists("pageActions")) |
| 1240 setupPageActionEvents(extensionId); | 1232 setupPageActionEvents(extensionId); |
| 1241 if (apiExists("experimental.socket")) | 1233 if (apiExists("experimental.socket")) |
| 1242 setupSocketEvents(); | 1234 setupSocketEvents(); |
| 1243 if (apiExists("ttsEngine")) | 1235 if (apiExists("ttsEngine")) |
| 1244 setupTtsEngineEvents(); | 1236 setupTtsEngineEvents(); |
| 1245 if (apiExists("tts")) | 1237 if (apiExists("tts")) |
| 1246 setupTtsEvents(); | 1238 setupTtsEvents(); |
| 1247 }); | 1239 }); |
| 1248 })(); | 1240 })(); |
| OLD | NEW |