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

Unified Diff: chrome/common/extensions/docs/examples/api/tabs/screenshot/screenshot.js

Issue 7003059: Added license header (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/examples/api/tabs/screenshot/screenshot.js
diff --git a/chrome/common/extensions/docs/examples/api/tabs/screenshot/screenshot.js b/chrome/common/extensions/docs/examples/api/tabs/screenshot/screenshot.js
index a003719870a753dc3b0cf91b36e979daa13513f6..88ae90cb3222fa1d88da863027aa5721517b7e8f 100644
--- a/chrome/common/extensions/docs/examples/api/tabs/screenshot/screenshot.js
+++ b/chrome/common/extensions/docs/examples/api/tabs/screenshot/screenshot.js
@@ -1,3 +1,7 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
// To make sure we can uniquely identify each screenshot tab, add an id as a
// query param to the url that displays the screenshot.
var id = 100;
@@ -44,5 +48,9 @@ function takeScreenshot() {
// Listen for a click on the camera icon. On that click, take a screenshot.
chrome.browserAction.onClicked.addListener(function(tab) {
- takeScreenshot();
+ if (tab.url.match(/code.google.com/)) {
+ takeScreenshot();
+ } else {
+ alert('This sample can only take screenshots of code.google.com pages');
+ }
});
« no previous file with comments | « chrome/common/extensions/docs/examples/api/tabs/screenshot/manifest.json ('k') | chrome/common/extensions/docs/samples.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698