| 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 apiFunctions.setHandleRequest("browserAction.setIcon", function(details) { | 1010 apiFunctions.setHandleRequest("browserAction.setIcon", function(details) { |
| 1011 setExtensionActionIconCommon( | 1011 setExtensionActionIconCommon( |
| 1012 details, this.name, this.definition.parameters, "browser action"); | 1012 details, this.name, this.definition.parameters, "browser action"); |
| 1013 }); | 1013 }); |
| 1014 | 1014 |
| 1015 apiFunctions.setHandleRequest("pageAction.setIcon", function(details) { | 1015 apiFunctions.setHandleRequest("pageAction.setIcon", function(details) { |
| 1016 setExtensionActionIconCommon( | 1016 setExtensionActionIconCommon( |
| 1017 details, this.name, this.definition.parameters, "page action"); | 1017 details, this.name, this.definition.parameters, "page action"); |
| 1018 }); | 1018 }); |
| 1019 | 1019 |
| 1020 apiFunctions.setHandleRequest("experimental.sidebar.setIcon", | |
| 1021 function(details) { | |
| 1022 var SIDEBAR_ICON_SIZE = 16; | |
| 1023 setIconCommon( | |
| 1024 details, this.name, this.definition.parameters, "sidebar", | |
| 1025 SIDEBAR_ICON_SIZE, SetIconCommon); | |
| 1026 }); | |
| 1027 | |
| 1028 apiFunctions.setHandleRequest("contextMenus.create", | 1020 apiFunctions.setHandleRequest("contextMenus.create", |
| 1029 function() { | 1021 function() { |
| 1030 var args = arguments; | 1022 var args = arguments; |
| 1031 var id = GetNextContextMenuId(); | 1023 var id = GetNextContextMenuId(); |
| 1032 args[0].generatedId = id; | 1024 args[0].generatedId = id; |
| 1033 sendRequest(this.name, args, this.definition.parameters, | 1025 sendRequest(this.name, args, this.definition.parameters, |
| 1034 {customCallback: this.customCallback}); | 1026 {customCallback: this.customCallback}); |
| 1035 return id; | 1027 return id; |
| 1036 }); | 1028 }); |
| 1037 | 1029 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1248 | 1240 |
| 1249 if (!chrome.tts) | 1241 if (!chrome.tts) |
| 1250 chrome.tts = {}; | 1242 chrome.tts = {}; |
| 1251 | 1243 |
| 1252 if (!chrome.ttsEngine) | 1244 if (!chrome.ttsEngine) |
| 1253 chrome.ttsEngine = {}; | 1245 chrome.ttsEngine = {}; |
| 1254 | 1246 |
| 1255 if (!chrome.experimental.downloads) | 1247 if (!chrome.experimental.downloads) |
| 1256 chrome.experimental.downloads = {}; | 1248 chrome.experimental.downloads = {}; |
| 1257 })(); | 1249 })(); |
| OLD | NEW |