diff options
author | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 19:42:29 +0000 |
---|---|---|
committer | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 19:42:29 +0000 |
commit | ca3e57300654b4885325712c0ff2ed0be062c637 (patch) | |
tree | 7d3ed98e58129ca4df95334cd3c9eaf8b819bd2d /chrome/common/extensions | |
parent | f86b15aa97d6d4d94d96e3f4b503160ca40dc3e4 (diff) | |
download | chromium_src-ca3e57300654b4885325712c0ff2ed0be062c637.zip chromium_src-ca3e57300654b4885325712c0ff2ed0be062c637.tar.gz chromium_src-ca3e57300654b4885325712c0ff2ed0be062c637.tar.bz2 |
Make chrome.idle have a permission.
BUG=None
TEST=browser_tests.exe --gtest_filter=ExtensionApiTest.ExperimentalPermissionsFail
Review URL: http://codereview.chromium.org/2976002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52122 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions')
-rw-r--r-- | chrome/common/extensions/docs/idle.html | 30 | ||||
-rw-r--r-- | chrome/common/extensions/docs/static/idle.html | 18 | ||||
-rw-r--r-- | chrome/common/extensions/extension.cc | 2 | ||||
-rw-r--r-- | chrome/common/extensions/extension.h | 1 |
4 files changed, 45 insertions, 6 deletions
diff --git a/chrome/common/extensions/docs/idle.html b/chrome/common/extensions/docs/idle.html index 353ecb0..04b57a7 100644 --- a/chrome/common/extensions/docs/idle.html +++ b/chrome/common/extensions/docs/idle.html @@ -15,7 +15,7 @@ </script> <script type="text/javascript" src="js/api_page_generator.js"></script> <script type="text/javascript" src="js/bootstrap.js"></script> - <title>chrome.idle - Google Chrome Extensions - Google Code</title></head><body> <div id="gc-container" class="labs"> + <title>Idle - Google Chrome Extensions - Google Code</title></head><body> <div id="gc-container" class="labs"> <div id="devModeWarning"> You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files. </div> @@ -208,16 +208,16 @@ <div class="g-unit" id="gc-pagecontent"> <div id="pageTitle"> - <h1 class="page_title">chrome.idle</h1> + <h1 class="page_title">Idle</h1> </div> <!-- TABLE OF CONTENTS --> <div id="toc"> <h2>Contents</h2> <ol> - <li style="display: none; "> - <a>h2Name</a> + <li> + <a href="#manifest">Manifest</a> <ol> - <li> + <li style="display: none; "> <a>h3Name</a> </li> </ol> @@ -264,7 +264,25 @@ <!-- /TABLE OF CONTENTS --> <!-- STATIC CONTENT PLACEHOLDER --> - <div id="static"></div> + <div id="static"><div id="pageData-name" class="pageData">Idle</div> + +<!-- BEGIN AUTHORED CONTENT --> +<h2 id="manifest">Manifest</h2> +<p>You must declare the "idle" permission in your extension's manifest to use the idle API. +For example: +</p> + +<pre>{ + "name": "My extension", + ... + <b>"permissions": [ + "idle" + ]</b>, + ... +}</pre> + +<!-- END AUTHORED CONTENT --> +</div> <!-- API PAGE --> <div class="apiPage"> diff --git a/chrome/common/extensions/docs/static/idle.html b/chrome/common/extensions/docs/static/idle.html new file mode 100644 index 0000000..10f7e1d --- /dev/null +++ b/chrome/common/extensions/docs/static/idle.html @@ -0,0 +1,18 @@ +<div id="pageData-name" class="pageData">Idle</div> + +<!-- BEGIN AUTHORED CONTENT --> +<h2 id="manifest">Manifest</h2> +<p>You must declare the "idle" permission in your extension's manifest to use the idle API. +For example: +</p> + +<pre>{ + "name": "My extension", + ... + <b>"permissions": [ + "idle" + ]</b>, + ... +}</pre> + +<!-- END AUTHORED CONTENT --> diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 33a3b03..a99d582 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -117,6 +117,7 @@ const char* Extension::kBookmarkPermission = "bookmarks"; const char* Extension::kExperimentalPermission = "experimental"; const char* Extension::kGeolocationPermission = "geolocation"; const char* Extension::kHistoryPermission = "history"; +const char* Extension::kIdlePermission = "idle"; const char* Extension::kNotificationPermission = "notifications"; const char* Extension::kTabPermission = "tabs"; const char* Extension::kUnlimitedStoragePermission = "unlimited_storage"; @@ -126,6 +127,7 @@ const char* Extension::kPermissionNames[] = { Extension::kBookmarkPermission, Extension::kExperimentalPermission, Extension::kGeolocationPermission, + Extension::kIdlePermission, Extension::kHistoryPermission, Extension::kNotificationPermission, Extension::kTabPermission, diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index fe7ac77..9685c9f 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -99,6 +99,7 @@ class Extension { static const char* kExperimentalPermission; static const char* kGeolocationPermission; static const char* kHistoryPermission; + static const char* kIdlePermission; static const char* kNotificationPermission; static const char* kTabPermission; static const char* kUnlimitedStoragePermission; |