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

Side by Side Diff: chrome/test/data/extensions/samples/cld/toolstrip.html

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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!--
2 Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
3 source code is governed by a BSD-style license that can be found in the
4 LICENSE file.
5 -->
6
7 <html>
8 <head>
9 <script>
10
11 var selectedId = -1;
12 function refreshLanguage() {
13 console.log("refeshing...");
14 chrome.tabs.getLanguage(null, function(language) {
15 document.getElementById("languageDiv").innerHTML = language;
16 });
17 }
18
19 chrome.tabs.onUpdated.addListener(function(tabId, props) {
20 console.log("updated: " + tabId);
21 if (prop.status == "complete" && tabId == selectedId)
22 refreshLanguage();
23 });
24
25 chrome.tabs.onSelectionChanged.addListener(function(tabId, props) {
26 console.log("selection: " + tabId);
27 selectedId = tabId;
28 refreshLanguage();
29 });
30 </script>
31 </head>
32 <body onload="refreshLanguage();">
33 <div id="languageDiv" class="toolstrip-button" onclick="refreshLanguage();">
34 </div>
35 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698