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

Side by Side Diff: chrome/renderer/resources/extension_process_bindings.js

Issue 150062: [chromium-reviews] Add getLanguage function to tabs extension (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
OLDNEW
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 = chrome || {}; 10 var chrome = chrome || {};
11 (function() { 11 (function() {
12 native function GetViews(); 12 native function GetViews();
13 native function GetWindow(); 13 native function GetWindow();
14 native function GetCurrentWindow(); 14 native function GetCurrentWindow();
15 native function GetLastFocusedWindow(); 15 native function GetLastFocusedWindow();
16 native function CreateWindow(); 16 native function CreateWindow();
17 native function UpdateWindow(); 17 native function UpdateWindow();
18 native function RemoveWindow(); 18 native function RemoveWindow();
19 native function GetAllWindows(); 19 native function GetAllWindows();
20 native function GetTab(); 20 native function GetTab();
21 native function GetSelectedTab(); 21 native function GetSelectedTab();
22 native function GetAllTabsInWindow(); 22 native function GetAllTabsInWindow();
23 native function CreateTab(); 23 native function CreateTab();
24 native function UpdateTab(); 24 native function UpdateTab();
25 native function MoveTab(); 25 native function MoveTab();
26 native function RemoveTab(); 26 native function RemoveTab();
27 native function GetTabLanguage();
jungshik at Google 2009/07/10 00:38:42 I'm afraid Get*Language gives a wrong impression (
27 native function EnablePageAction(); 28 native function EnablePageAction();
28 native function DisablePageAction(); 29 native function DisablePageAction();
29 native function GetBookmarks(); 30 native function GetBookmarks();
30 native function GetBookmarkChildren(); 31 native function GetBookmarkChildren();
31 native function GetBookmarkTree(); 32 native function GetBookmarkTree();
32 native function SearchBookmarks(); 33 native function SearchBookmarks();
33 native function RemoveBookmark(); 34 native function RemoveBookmark();
34 native function CreateBookmark(); 35 native function CreateBookmark();
35 native function MoveBookmark(); 36 native function MoveBookmark();
36 native function SetBookmarkTitle(); 37 native function SetBookmarkTitle();
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 chrome.tabs.remove = function(tabId, callback) { 307 chrome.tabs.remove = function(tabId, callback) {
307 validate(arguments, arguments.callee.params); 308 validate(arguments, arguments.callee.params);
308 sendRequest(RemoveTab, tabId, callback); 309 sendRequest(RemoveTab, tabId, callback);
309 }; 310 };
310 311
311 chrome.tabs.remove.params = [ 312 chrome.tabs.remove.params = [
312 chrome.types.pInt, 313 chrome.types.pInt,
313 chrome.types.optFun 314 chrome.types.optFun
314 ]; 315 ];
315 316
317 chrome.tabs.getLanguage = function(tabId, callback) {
318 validate(arguments, arguments.callee.params);
319 sendRequest(GetTabLanguage, tabId, callback);
320 };
321
322 chrome.tabs.getLanguage.params = [
323 chrome.types.optPInt,
324 chrome.types.optFun
325 ];
326
316 // Sends ({Tab}). 327 // Sends ({Tab}).
317 // Will *NOT* be followed by tab-attached - it is implied. 328 // Will *NOT* be followed by tab-attached - it is implied.
318 // *MAY* be followed by tab-selection-changed. 329 // *MAY* be followed by tab-selection-changed.
319 chrome.tabs.onCreated = new chrome.Event("tab-created"); 330 chrome.tabs.onCreated = new chrome.Event("tab-created");
320 331
321 // Sends (tabId, {ChangedProps}). 332 // Sends (tabId, {ChangedProps}).
322 chrome.tabs.onUpdated = new chrome.Event("tab-updated"); 333 chrome.tabs.onUpdated = new chrome.Event("tab-updated");
323 334
324 // Sends (tabId, {windowId, fromIndex, toIndex}). 335 // Sends (tabId, {windowId, fromIndex, toIndex}).
325 // Tabs can only "move" within a window. 336 // Tabs can only "move" within a window.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 chrome.extension = new chrome.Extension(extensionId); 544 chrome.extension = new chrome.Extension(extensionId);
534 // TODO(mpcomplete): self.onConnect is deprecated. Remove it at 1.0. 545 // TODO(mpcomplete): self.onConnect is deprecated. Remove it at 1.0.
535 // http://code.google.com/p/chromium/issues/detail?id=16356 546 // http://code.google.com/p/chromium/issues/detail?id=16356
536 chrome.self.onConnect = new chrome.Event("channel-connect:" + extensionId); 547 chrome.self.onConnect = new chrome.Event("channel-connect:" + extensionId);
537 }); 548 });
538 549
539 chrome.self.getViews = function() { 550 chrome.self.getViews = function() {
540 return GetViews(); 551 return GetViews();
541 } 552 }
542 })(); 553 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698