OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 apiFunctions.setHandleRequest("browserAction.setIcon", function(details) { | 1014 apiFunctions.setHandleRequest("browserAction.setIcon", function(details) { |
1015 setExtensionActionIconCommon( | 1015 setExtensionActionIconCommon( |
1016 details, this.name, this.definition.parameters, "browser action"); | 1016 details, this.name, this.definition.parameters, "browser action"); |
1017 }); | 1017 }); |
1018 | 1018 |
1019 apiFunctions.setHandleRequest("pageAction.setIcon", function(details) { | 1019 apiFunctions.setHandleRequest("pageAction.setIcon", function(details) { |
1020 setExtensionActionIconCommon( | 1020 setExtensionActionIconCommon( |
1021 details, this.name, this.definition.parameters, "page action"); | 1021 details, this.name, this.definition.parameters, "page action"); |
1022 }); | 1022 }); |
1023 | 1023 |
1024 apiFunctions.setHandleRequest("experimental.sidebar.setIcon", | |
1025 function(details) { | |
1026 var SIDEBAR_ICON_SIZE = 16; | |
1027 setIconCommon( | |
1028 details, this.name, this.definition.parameters, "sidebar", | |
1029 SIDEBAR_ICON_SIZE); | |
1030 }); | |
1031 | |
1032 apiFunctions.setHandleRequest("contextMenus.create", | 1024 apiFunctions.setHandleRequest("contextMenus.create", |
1033 function() { | 1025 function() { |
1034 var args = arguments; | 1026 var args = arguments; |
1035 var id = GetNextContextMenuId(); | 1027 var id = GetNextContextMenuId(); |
1036 args[0].generatedId = id; | 1028 args[0].generatedId = id; |
1037 sendRequest(this.name, args, this.definition.parameters, | 1029 sendRequest(this.name, args, this.definition.parameters, |
1038 {customCallback: this.customCallback}); | 1030 {customCallback: this.customCallback}); |
1039 return id; | 1031 return id; |
1040 }); | 1032 }); |
1041 | 1033 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 if (apiExists("pageActions")) | 1228 if (apiExists("pageActions")) |
1237 setupPageActionEvents(extensionId); | 1229 setupPageActionEvents(extensionId); |
1238 if (apiExists("experimental.socket")) | 1230 if (apiExists("experimental.socket")) |
1239 setupSocketEvents(); | 1231 setupSocketEvents(); |
1240 if (apiExists("ttsEngine")) | 1232 if (apiExists("ttsEngine")) |
1241 setupTtsEngineEvents(); | 1233 setupTtsEngineEvents(); |
1242 if (apiExists("tts")) | 1234 if (apiExists("tts")) |
1243 setupTtsEvents(); | 1235 setupTtsEvents(); |
1244 }); | 1236 }); |
1245 })(); | 1237 })(); |
OLD | NEW |