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

Side by Side Diff: chrome/common/extensions/docs/examples/api/infobars/sandwichbar/background.js

Issue 20081002: Remove experimental permission from infobars API and moving it to dev channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added license header Created 7 years, 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
1 /** 5 /**
2 * Handles requests sent by the content script. Shows an infobar. 6 * Handles requests sent by the content script. Shows an infobar.
3 */ 7 */
4 function onRequest(request, sender, sendResponse) { 8 function onRequest(request, sender, sendResponse) {
5 // The number of matches is sent in the request - pass it to the 9 // The number of matches is sent in the request - pass it to the
6 // infobar. 10 // infobar.
7 var url = "infobar.html#" + request.count; 11 var url = "infobar.html#" + request.count;
8 12
9 // Show the infobar on the tab where the request was sent. 13 // Show the infobar on the tab where the request was sent.
10 chrome.experimental.infobars.show({ 14 chrome.infobars.show({
11 tabId: sender.tab.id, 15 tabId: sender.tab.id,
12 path: url 16 path: url
13 }); 17 });
14 18
15 // Return nothing to let the connection be cleaned up. 19 // Return nothing to let the connection be cleaned up.
16 sendResponse({}); 20 sendResponse({});
17 }; 21 };
18 22
19 // Listen for the content script to send a message to the background page. 23 // Listen for the content script to send a message to the background page.
20 chrome.extension.onRequest.addListener(onRequest); 24 chrome.extension.onRequest.addListener(onRequest);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698