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

Issue 12576018: Add chrome.power extension API. (Closed)

Created:
7 years, 9 months ago by Daniel Erat
Modified:
7 years, 9 months ago
CC:
chromium-reviews, nkostylev+watch_chromium.org, Aaron Boodman, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Add chrome.power extension API. This moves the chrome.experimental.power API to chrome.power, makes minor changes to its public interface (adding a "level" parameter to requestKeepAwake() and removing the callbacks from both methods), adds unit tests for it, and adds a sample "Keep Awake" extension meant to replace the existing Chrome OS-specific extension at http://goo.gl/CrUzi. BUG=178944 TBR=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=189253

Patch Set 1 #

Patch Set 2 : use constants in tests #

Patch Set 3 : make api chrome-os-only initially, per go/no-go meeting #

Patch Set 4 : restrict to chrome os via _permission_features.json #

Patch Set 5 : update PermissionsTest.PermissionMessages #

Total comments: 26

Patch Set 6 : apply review feedback #

Total comments: 6

Patch Set 7 : make level parameter mandatory #

Patch Set 8 : add copyright notice to example extension #

Unified diffs Side-by-side diffs Delta from patch set Stats (+695 lines, -428 lines) Patch
D chrome/browser/chromeos/extensions/power/power_api.h View 1 chunk +0 lines, -40 lines 0 comments Download
D chrome/browser/chromeos/extensions/power/power_api.cc View 1 chunk +0 lines, -29 lines 0 comments Download
D chrome/browser/chromeos/extensions/power/power_api_browsertest.cc View 1 2 3 4 5 1 chunk +0 lines, -166 lines 0 comments Download
D chrome/browser/chromeos/extensions/power/power_api_manager.h View 1 chunk +0 lines, -65 lines 0 comments Download
D chrome/browser/chromeos/extensions/power/power_api_manager.cc View 1 chunk +0 lines, -69 lines 0 comments Download
A + chrome/browser/extensions/api/power/power_api.h View 3 chunks +7 lines, -9 lines 0 comments Download
A chrome/browser/extensions/api/power/power_api.cc View 1 2 3 4 5 6 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/power/power_api_manager.h View 1 2 3 4 5 1 chunk +79 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/power/power_api_manager.cc View 1 2 3 4 5 6 1 chunk +109 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/power/power_api_unittest.cc View 1 2 3 4 5 6 1 chunk +282 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_function_histogram_value.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 5 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/_permission_features.json View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/api.gyp View 3 2 chunks +1 line, -1 line 0 comments Download
D chrome/common/extensions/api/experimental_power.json View 1 2 3 4 5 1 chunk +0 lines, -53 lines 0 comments Download
A chrome/common/extensions/api/power.idl View 1 2 3 4 5 6 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/_locales/en/messages.json View 1 chunk +22 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/background.js View 1 2 3 4 5 6 7 1 chunk +113 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/day-19.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/day-38.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/icon-128.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/icon-16.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/icon-48.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/night-19.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/night-38.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/sunset-19.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/images/sunset-38.png View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/common/extensions/docs/examples/api/power/manifest.json View 1 chunk +24 lines, -0 lines 0 comments Download
M chrome/common/extensions/permissions/api_permission.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/permissions/api_permission.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/permissions/permission_set_unittest.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Daniel Erat
7 years, 9 months ago (2013-03-19 00:47:01 UTC) #1
not at google - send to devlin
sorry, forgot about this until now. Main comment is making the level an enum. https://codereview.chromium.org/12576018/diff/28001/chrome/browser/extensions/api/power/power_api.cc ...
7 years, 9 months ago (2013-03-19 21:16:39 UTC) #2
Daniel Erat
https://codereview.chromium.org/12576018/diff/28001/chrome/browser/extensions/api/power/power_api.cc File chrome/browser/extensions/api/power/power_api.cc (right): https://codereview.chromium.org/12576018/diff/28001/chrome/browser/extensions/api/power/power_api.cc#newcode21 chrome/browser/extensions/api/power/power_api.cc:21: level = PowerApiManager::LEVEL_SYSTEM; On 2013/03/19 21:16:39, kalman wrote: > ...
7 years, 9 months ago (2013-03-19 23:39:38 UTC) #3
not at google - send to devlin
lgtm https://codereview.chromium.org/12576018/diff/28001/chrome/common/extensions/api/_permission_features.json File chrome/common/extensions/api/_permission_features.json (right): https://codereview.chromium.org/12576018/diff/28001/chrome/common/extensions/api/_permission_features.json#newcode318 chrome/common/extensions/api/_permission_features.json:318: "extension_types": ["extension", "hosted_app", "packaged_app"] On 2013/03/19 23:39:38, Daniel ...
7 years, 9 months ago (2013-03-20 00:25:50 UTC) #4
Daniel Erat
https://codereview.chromium.org/12576018/diff/42001/chrome/browser/extensions/api/power/power_api.cc File chrome/browser/extensions/api/power/power_api.cc (right): https://codereview.chromium.org/12576018/diff/42001/chrome/browser/extensions/api/power/power_api.cc#newcode17 chrome/browser/extensions/api/power/power_api.cc:17: params->level == api::power::LEVEL_NONE ? api::power::LEVEL_DISPLAY : On 2013/03/20 00:25:50, ...
7 years, 9 months ago (2013-03-20 00:47:46 UTC) #5
Daniel Erat
TBR sky for chrome/*.gypi
7 years, 9 months ago (2013-03-20 01:04:03 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/derat@chromium.org/12576018/54004
7 years, 9 months ago (2013-03-20 01:15:46 UTC) #7
commit-bot: I haz the power
Presubmit check for 12576018-54004 failed and returned exit status 1. INFO:root:Found 28 file(s). Running presubmit ...
7 years, 9 months ago (2013-03-20 01:15:57 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/derat@chromium.org/12576018/63002
7 years, 9 months ago (2013-03-20 01:32:30 UTC) #9
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) content_unittests, ipc_tests, remoting_unittests, sql_unittests, sync_unit_tests, unit_tests ...
7 years, 9 months ago (2013-03-20 02:34:03 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/derat@chromium.org/12576018/63002
7 years, 9 months ago (2013-03-20 02:37:45 UTC) #11
Daniel Erat
https://codereview.chromium.org/12576018/diff/28001/chrome/common/extensions/api/_permission_features.json File chrome/common/extensions/api/_permission_features.json (right): https://codereview.chromium.org/12576018/diff/28001/chrome/common/extensions/api/_permission_features.json#newcode318 chrome/common/extensions/api/_permission_features.json:318: "extension_types": ["extension", "hosted_app", "packaged_app"] On 2013/03/20 00:25:50, kalman wrote: ...
7 years, 9 months ago (2013-03-20 03:45:25 UTC) #12
commit-bot: I haz the power
Change committed as 189253
7 years, 9 months ago (2013-03-20 12:18:28 UTC) #13
not at google - send to devlin
7 years, 9 months ago (2013-03-20 14:58:08 UTC) #14
Message was sent while issue was closed.
https://codereview.chromium.org/12576018/diff/28001/chrome/common/extensions/...
File chrome/common/extensions/api/_permission_features.json (right):

https://codereview.chromium.org/12576018/diff/28001/chrome/common/extensions/...
chrome/common/extensions/api/_permission_features.json:318: "extension_types":
["extension", "hosted_app", "packaged_app"]
On 2013/03/20 03:45:25, Daniel Erat wrote:
> On 2013/03/20 00:25:50, kalman wrote:
> > On 2013/03/19 23:39:38, Daniel Erat wrote:
> > > On 2013/03/19 21:16:39, kalman wrote:
> > > > why hosted_app?
> > > 
> > > The intent is to permit e.g. a slide show app to prevent the screen from
> > dimming
> > > while displaying a presentation.
> > 
> > Ah, cool. Let's include platform_app too, then.
> 
> Whoops, I missed this.  I'll add it in a second change, if that's okay.
> 
> Is there documentation somewhere about what exactly platform_app refers to?  I
> think I understand hosted vs. packaged, but I'm left guessing about "packaged"
> -- does it refer to v1 apps?

Agreed, we need to document this. Packaged is v1, platform is v2.

Powered by Google App Engine
This is Rietveld 408576698