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

Side by Side Diff: chrome/common/extensions/docs/examples/extensions/mappy/popup.html

Issue 8311007: Adding `content_security_policy` to the "Mappy" sample. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebasing. 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
1 <head> 1 <!doctype html>
2 <style> 2 <html>
3 body { 3 <head>
4 margin: 0px; 4 <title>Popup</title>
5 padding: 0px; 5 <link href="popup.css" rel="stylesheet" type="text/css">
6 } 6 </head>
7 #map { 7 <body>
8 width: 512px; 8 <img id="map">
9 height: 512px; 9 <script src="popup.js"></script>
10 } 10 </body>
11 </style> 11 </html>
12 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAATfHumD bW3OmRByfquHd3SRTRERdeAiwZ9EeJWta3L_JZVS0bOBRQeZgr4K0xyVKzUdnnuFl8X9PX0w&sensor= false"
13 type="text/javascript"></script>
14 <script>
15 var maps_key = "ABQIAAAATfHumDbW3OmRByfquHd3SRTRERdeAiwZ9EeJWta3L_JZVS0bOBRQeZgr 4K0xyVKzUdnnuFl8X9PX0w";
16
17 function gclient_geocode(address) {
18 var geocoder = new GClientGeocoder();
19 geocoder.getLatLng(address, function(point) {
20 if (!point) {
21 console.log(address + " not found");
22 } else {
23 var latlng = point.toUrlValue();
24 var url = "http://maps.google.com/staticmap?center=" + latlng +
25 "&markers=" + latlng + "&zoom=14" +
26 "&size=512x512&sensor=false&key=" + maps_key;
27 var map = document.getElementById("map");
28 map.src = url;
29 }
30 });
31 }
32
33 function map() {
34 var address = chrome.extension.getBackgroundPage().selectedAddress;
35 if (address)
36 gclient_geocode(address);
37 };
38 </script>
39 </head>
40 <body onload="map()">
41 <img id="map" onclick="window.close()">
42 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698