diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-29 20:03:07 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-29 20:03:07 +0000 |
commit | 072bbfa45e16385741fd00dede5c4c31e42438a6 (patch) | |
tree | f9bce083a9fc551dba0219582e1db774a18e64e9 /chrome/test/data/extensions/samples/gmail | |
parent | dacb10dd3adcd8bed394fef63657a0b8ad45ffe4 (diff) | |
download | chromium_src-072bbfa45e16385741fd00dede5c4c31e42438a6.zip chromium_src-072bbfa45e16385741fd00dede5c4c31e42438a6.tar.gz chromium_src-072bbfa45e16385741fd00dede5c4c31e42438a6.tar.bz2 |
Part 1 of sample sprucing. Also, change chromium_extension.py to generate a random ID if the manifest doesn't have one.
* Create a test/data/extensions/samples directory and add
Reader and Gmail samples to it.
* Minor fixes to buildbot sample to fit better visually.
* Minor fixes to bookmarks sample to use new button styles.
* Workaround for bug in bookmark sample where extension APIs do
not load the first time.
* Move Resizer extension into samples/.
* Fix TabsAPI sample to not use old deprecated manifest
properties anymore.
Part 2 will move the remaining samples into samples/ (don't want
to do that at the same time because git-cl doesn't know how to
tell Rietveld about moves and it would be confusing to review).
Review URL: http://codereview.chromium.org/99172
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/extensions/samples/gmail')
-rw-r--r-- | chrome/test/data/extensions/samples/gmail/extensions_toolstrip.css | 89 | ||||
-rw-r--r-- | chrome/test/data/extensions/samples/gmail/gmail.png | bin | 0 -> 48123 bytes | |||
-rw-r--r-- | chrome/test/data/extensions/samples/gmail/gmail_checker.html | 89 | ||||
-rw-r--r-- | chrome/test/data/extensions/samples/gmail/manifest.json | 13 | ||||
-rw-r--r-- | chrome/test/data/extensions/samples/gmail/styles.css | 16 |
5 files changed, 207 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/samples/gmail/extensions_toolstrip.css b/chrome/test/data/extensions/samples/gmail/extensions_toolstrip.css new file mode 100644 index 0000000..3ba1892 --- /dev/null +++ b/chrome/test/data/extensions/samples/gmail/extensions_toolstrip.css @@ -0,0 +1,89 @@ +/** + * NOTE: This shouldn't need to be included in every toolstrip manually, but we + * currently have a race where it sometimes isn't applied, so we include it + * manually to be sure. In the future, these styles will be applied to all + * toolstrips automatically. + */ + + +/** + * Body styles. This makes the toolstrip layout fit in with the Windows + * bookmarkbar. Note that the background is provided separately, by + * RenderWidget. + */ +body { + display:-webkit-box; + -webkit-box-orient:horizontal; + -webkit-box-align:stretch; + white-space:nowrap; + overflow: hidden; + margin: 0; + padding:0; + font: menu; + color: #062D75; + text-shadow: #FFFFFF 1px 1px 0px; + -webkit-user-select:none; + cursor:default; +} + +/** + * Toolstrip Buttons. The following styles make + * <div class="toolstrip-button"><img><span>Woot</span></div> look like the + * bookmarkbar buttons on Windows. + * + * TODO(aa): We may have to come up with a way to modify these slightly on + * different platforms. + * + * TODO(aa): It would be nice if we could use actual <button> tags work here, + * which should work once https://bugs.webkit.org/show_bug.cgi?id=25406 is + * fixed. + */ +div.toolstrip-button { + display:-webkit-box; + -webkit-box-orient:horizontal; + -webkit-box-align:center; + border:6px solid transparent; + font:menu; + background:transparent; + color: #062D75; + text-shadow: #FFFFFF 1px 1px 0px; + line-height:100%; + padding:0; +} + +div.toolstrip-button>img { + display:-webkit-box; + width:16px; + height:16px; + /** + * We inset the image slightly vertically, so that the button can be shorter + * than would otherwise be possibe with our fat borders. + */ + margin:-1px 5px -1px 0; +} + +div.toolstrip-button>span { + display:-webkit-box; + margin-right:1px; + /** + * Hack: WebKit appears to measure text height slightly differently than we do + * in native code, making us not line up when centering, so we shift ourselves + * up one pixel to match. + */ + margin-top:-1px; +} + +/** + * TODO(aa): It would be nice if these border images could be stored in Chrome + * as, normal images even if those images are just translated into data URLs at + * runtime. + */ +div.toolstrip-button:hover { + border-width:6px; + -webkit-border-image:url(data:image/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r8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAaFJREFUeNqklOlu2zAQhL+laFKHrSRt2vd/sj5AA7RpdFG0zM0PWT4Cx27dAfYPMcPZCys/fgZlD1U9CwAROYsFVuQo2MbIMPTEODJN00ywFuc8RVGycu7wgZW90zgMDH3D46Zi862mKnIAuiHQtAOvzStFuSEvilmoCtu4Zehbvn994KleowrTLqGAWzmevzhW1vLy+40sszjvsaCE0PO4qXh6WJMUkh7KBgEF6roiThNd6HHeYVSVOI7U6xxVSElPNRzbAVWRE8cRVcWiSko7ityTVM+Ipx8A5N6R0g5UMXMqijHCaYaXYIygKAiYj+ncwsI33AnzcSNuOu75/+F4d41yh93S1Tt0e0e5ntalRysnBLni8G9zFJnjAuxhjldIp+9ncxQRUko3m5JSOiyLMSLYLCOM8aZwjFtslmFEMGIE5z1dH7i1eX0IOO8RI7NjWZY0bUfbdJ+Kmqala3vKssSIzM1xzlGua379eSPuJoo8J/cegDCOdEOga3uqTY1bLt1Ls9XlPMYYGfpPzmNZHkUiWFiOLXif45z/q4P8PgC/bsLRhT00kAAAAABJRU5ErkJggg==) 6 round round; +} + +div.toolstrip-button:active { + border-width:6px; + -webkit-border-image:url(data:image/png;base64,iVBORw0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gikOuhSPyTGZvwcAgLLi1uEcpE8AAAAASUVORK5CYII=) 6 round round; +} diff --git a/chrome/test/data/extensions/samples/gmail/gmail.png b/chrome/test/data/extensions/samples/gmail/gmail.png Binary files differnew file mode 100644 index 0000000..24180e0 --- /dev/null +++ b/chrome/test/data/extensions/samples/gmail/gmail.png diff --git a/chrome/test/data/extensions/samples/gmail/gmail_checker.html b/chrome/test/data/extensions/samples/gmail/gmail_checker.html new file mode 100644 index 0000000..1e461e5 --- /dev/null +++ b/chrome/test/data/extensions/samples/gmail/gmail_checker.html @@ -0,0 +1,89 @@ +<html> +<head> +<link rel="stylesheet" type="text/css" href="extensions_toolstrip.css"> +<link rel="stylesheet" type="text/css" href="styles.css"> +<script> +gmail_atom_href = "http://mail.google.com/mail/feed/atom"; +var poll_timeout = 2000; +var unreadCount; +var debug = true; + +function gmailNSResolver(prefix) { + if(prefix == 'gmail') { + return 'http://purl.org/atom/ns#'; + } +} + +function startFlip() { + document.getElementById("unreadCount").className = 'mid-flip'; + setTimeout("midFlip();", 500); +} + +function midFlip() { + document.getElementById("unreadCount").className = 'post-flip'; + document.getElementById("unreadCount").innerHTML = "(" + unreadCount + ")"; + setTimeout("endFlip();", 500); +} + +function endFlip() { + document.getElementById("unreadCount").className = 'base-flip'; +} + +function updateUnreadCount(count) { + if (unreadCount != count) { + unreadCount = count; + startFlip(); + } +} + +function requestUnreadFeed() { + var xhr = new XMLHttpRequest(); + try { + console.log("request.."); + xhr.onreadystatechange = function(){ + console.log("readystate: " + xhr.readyState); + if (xhr.readyState == 4) { + console.log("response.."); + var xmlDoc = xhr.responseXML; + var fullCountSet = xmlDoc.evaluate("/gmail:feed/gmail:fullcount", + xmlDoc, gmailNSResolver, XPathResult.ANY_TYPE, null); + var fullCountNode = fullCountSet.iterateNext(); + if (fullCountNode) { + updateUnreadCount(fullCountNode.textContent); + } else { + console.log("fullcount not found!"); + console.error("Error: feed retrieved, but no <fullcount> node found"); + } + + window.setTimeout(requestUnreadFeed, poll_timeout); + } + } + + xhr.onerror = function(error) { + debugger; + console.log("error: " + error); + window.setTimeout(requestUnreadFeed, poll_timeout); + } + + xhr.open("GET", gmail_atom_href); + xhr.send({}); + } catch(e) { + console.log("ex: " + e); + console.error("exception: " + e); + window.setTimeout(requestUnreadFeed, poll_timeout); + } +} + +function goToInbox() { + chromium.tabs.createTab({url:"http://www.gmail.com/"}); +} + +</script> +</head> +<body onload="requestUnreadFeed();" onclick="goToInbox()"> + <div class="toolstrip-button"> + <img src="gmail.png" style="width:auto; height:auto"> + <span>Gmail - Inbox <span style="display: inline-block;" id="unreadCount" class="base-flip" onclick="startFlip();"></span></span> + </div> +</body> +</html> diff --git a/chrome/test/data/extensions/samples/gmail/manifest.json b/chrome/test/data/extensions/samples/gmail/manifest.json new file mode 100644 index 0000000..bf7faf7 --- /dev/null +++ b/chrome/test/data/extensions/samples/gmail/manifest.json @@ -0,0 +1,13 @@ +{ + "description": "Displays number of unread Gmail messages", + "id": "DE6C0EDB5E435EC06E4E0E36E77EB241E1831273", + "name": "Gmail Checker", + "permissions": [ + "http://*.google.com/*", + "https://*.google.com/*" + ], + "toolstrips": [ + "gmail_checker.html" + ], + "version": "0.1" +}
\ No newline at end of file diff --git a/chrome/test/data/extensions/samples/gmail/styles.css b/chrome/test/data/extensions/samples/gmail/styles.css new file mode 100644 index 0000000..5587c1f --- /dev/null +++ b/chrome/test/data/extensions/samples/gmail/styles.css @@ -0,0 +1,16 @@ +.base-flip { + opacity: 1; +} + +.mid-flip { + opacity: .1; + color:red; + -webkit-transform: rotate(180deg) scale(1.3); + -webkit-transition: all .5s ease-in; +} + +.post-flip { + opacity: 1; + -webkit-transform: rotate(360deg) scale(1); + -webkit-transition: all .5s ease-out; +} |