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

Side by Side Diff: chrome/common/extensions/docs/examples/extensions/imageinfo/background.js

Issue 8310002: Adding `content_security_policy` to imageinfo extension. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Docs. Created 9 years, 2 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
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * Returns a handler which will open a new window when activated.
7 */
8 function getClickHandler() {
9 return function(info, tab) {
10
11 // The srcUrl property is only available for image elements.
12 var url = 'info.html#' + info.srcUrl;
13
14 // Create a new window to the info page.
15 chrome.windows.create({ url: url, width: 520, height: 660 });
16 };
17 };
18
19 /**
20 * Create a context menu which will only show up for images.
21 */
22 chrome.contextMenus.create({
23 "title" : "Get image info",
24 "type" : "normal",
25 "contexts" : ["image"],
26 "onclick" : getClickHandler()
27 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698