From ca3e57300654b4885325712c0ff2ed0be062c637 Mon Sep 17 00:00:00 2001 From: "levin@chromium.org" Date: Mon, 12 Jul 2010 19:42:29 +0000 Subject: 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 --- chrome/common/extensions/docs/idle.html | 30 ++++++++++++++++++++------ chrome/common/extensions/docs/static/idle.html | 18 ++++++++++++++++ chrome/common/extensions/extension.cc | 2 ++ chrome/common/extensions/extension.h | 1 + 4 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 chrome/common/extensions/docs/static/idle.html (limited to 'chrome/common/extensions') 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 @@ - chrome.idle - Google Chrome Extensions - Google Code
+ Idle - Google Chrome Extensions - Google Code
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.
@@ -208,16 +208,16 @@
-

chrome.idle

+

Idle

Contents

    -
  1. - h2Name +
  2. + Manifest
      -
    1. +
    2. h3Name
    @@ -264,7 +264,25 @@ -
    +
    Idle
    + + +

    Manifest

    +

    You must declare the "idle" permission in your extension's manifest to use the idle API. +For example: +

    + +
    {
    +  "name": "My extension",
    +  ...
    +  "permissions": [
    +    "idle"
    +  ],
    +  ...
    +}
    + + +
    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 @@ +
    Idle
    + + +

    Manifest

    +

    You must declare the "idle" permission in your extension's manifest to use the idle API. +For example: +

    + +
    {
    +  "name": "My extension",
    +  ...
    +  "permissions": [
    +    "idle"
    +  ],
    +  ...
    +}
    + + 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; -- cgit v1.1