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

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

Issue 923463003: [Extensions] Remove the Infobar API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 years, 10 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
(Empty)
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
5 /**
6 * Handles requests sent by the content script. Shows an infobar.
7 */
8 function onRequest(request, sender, sendResponse) {
9 // The number of matches is sent in the request - pass it to the
10 // infobar.
11 var url = "infobar.html#" + request.count;
12
13 // Show the infobar on the tab where the request was sent.
14 chrome.infobars.show({
15 tabId: sender.tab.id,
16 path: url
17 });
18
19 // Return nothing to let the connection be cleaned up.
20 sendResponse({});
21 };
22
23 // Listen for the content script to send a message to the background page.
24 chrome.extension.onRequest.addListener(onRequest);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698