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

Issue 1758013002: WebUI: Allow rejecting a promise that is returned from cr.sendWithPromise(). (Closed)

Created:
4 years, 9 months ago by dpapad
Modified:
4 years, 9 months ago
Reviewers:
Dan Beam
CC:
chromium-reviews, Dan Beam, oshima+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

WebUI: Allow rejecting a promise that is returned from cr.sendWithPromise(). - Moving PromiseResolver helper class such that it can be used from cr.js - Updating cr.webUIResponse to accept an isSuccess parameter. - Renaming SettingsPageUIHandler#CallJavascriptCallback to ResolveJavascriptCallback, and adding new RejectJavascriptCallback method. - Adding test. BUG=591266 Committed: https://crrev.com/8b4b5952c3259661772fb882053bbe67b9de2a67 Cr-Commit-Position: refs/heads/master@{#379104}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Move one level up #

Patch Set 3 : Nits. #

Patch Set 4 : Adding promise_resolver.html #

Patch Set 5 : Implement reject promise. #

Patch Set 6 : s/isSuccess/is_success #

Patch Set 7 : Add missing @param #

Patch Set 8 : nit #

Total comments: 6

Patch Set 9 : Addressing comments. #

Total comments: 2

Patch Set 10 : Re-rename #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -60 lines) Patch
M chrome/browser/ui/webui/settings/appearance_handler.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/md_settings_ui.h View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/settings/md_settings_ui.cc View 1 2 3 4 5 6 7 8 9 1 chunk +15 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/settings/search_engines_handler.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/settings/site_settings_handler.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
D chrome/test/data/webui/promise_resolver.js View 1 chunk +0 lines, -34 lines 0 comments Download
M chrome/test/data/webui/settings/cr_settings_browsertest.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/webui/webui_resource_async_browsertest.js View 1 2 3 4 3 chunks +20 lines, -2 lines 0 comments Download
M ui/webui/resources/html/cr.html View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A ui/webui/resources/html/promise_resolver.html View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M ui/webui/resources/js/cr.js View 1 2 3 4 5 6 7 3 chunks +15 lines, -10 lines 0 comments Download
A + ui/webui/resources/js/promise_resolver.js View 1 1 chunk +1 line, -3 lines 0 comments Download
M ui/webui/resources/webui_resources.grd View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (10 generated)
dpapad
https://codereview.chromium.org/1758013002/diff/1/ui/webui/resources/js/cr.js File ui/webui/resources/js/cr.js (right): https://codereview.chromium.org/1758013002/diff/1/ui/webui/resources/js/cr.js#newcode16 ui/webui/resources/js/cr.js:16: var cr = cr || function() { Every time ...
4 years, 9 months ago (2016-03-02 19:14:55 UTC) #1
Dan Beam
https://codereview.chromium.org/1758013002/diff/1/ui/webui/resources/js/cr/promise_resolver.js File ui/webui/resources/js/cr/promise_resolver.js (right): https://codereview.chromium.org/1758013002/diff/1/ui/webui/resources/js/cr/promise_resolver.js#newcode19 ui/webui/resources/js/cr/promise_resolver.js:19: cr.define('cr', function() { why does this need to be ...
4 years, 9 months ago (2016-03-02 19:17:40 UTC) #3
dpapad
In my next CL I will attempt to use PromiseResolver from within cr.js. Is it ...
4 years, 9 months ago (2016-03-02 20:02:09 UTC) #5
Dan Beam
yeah, we can put this in cr.js if you'd like i'm fine with it being ...
4 years, 9 months ago (2016-03-02 20:04:03 UTC) #6
dpapad
On 2016/03/02 at 20:04:03, dbeam wrote: > yeah, we can put this in cr.js if ...
4 years, 9 months ago (2016-03-02 20:12:23 UTC) #7
dpapad
On 2016/03/02 at 20:12:23, dpapad wrote: > On 2016/03/02 at 20:04:03, dbeam wrote: > > ...
4 years, 9 months ago (2016-03-02 20:27:46 UTC) #8
dpapad
Ready for review, PTAL. I went with the approach of keeping PromiseResolver on its own ...
4 years, 9 months ago (2016-03-02 22:41:23 UTC) #11
Dan Beam
https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/appearance_handler.cc File chrome/browser/ui/webui/settings/appearance_handler.cc (left): https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/appearance_handler.cc#oldcode78 chrome/browser/ui/webui/settings/appearance_handler.cc:78: base::FundamentalValue enabled(QueryResetThemeEnabledState()); this was prettier https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/md_settings_ui.cc File chrome/browser/ui/webui/settings/md_settings_ui.cc (right): ...
4 years, 9 months ago (2016-03-03 19:04:51 UTC) #12
dpapad
https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/appearance_handler.cc File chrome/browser/ui/webui/settings/appearance_handler.cc (left): https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/appearance_handler.cc#oldcode78 chrome/browser/ui/webui/settings/appearance_handler.cc:78: base::FundamentalValue enabled(QueryResetThemeEnabledState()); On 2016/03/03 at 19:04:51, Dan Beam wrote: ...
4 years, 9 months ago (2016-03-03 19:51:22 UTC) #13
dpapad
https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/md_settings_ui.cc File chrome/browser/ui/webui/settings/md_settings_ui.cc (right): https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/md_settings_ui.cc#newcode47 chrome/browser/ui/webui/settings/md_settings_ui.cc:47: void SettingsPageUIHandler::CallJavascriptCallback( On 2016/03/03 at 19:04:51, Dan Beam wrote: ...
4 years, 9 months ago (2016-03-03 19:51:53 UTC) #14
dpapad
On 2016/03/03 at 19:51:22, dpapad wrote: > https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/appearance_handler.cc > File chrome/browser/ui/webui/settings/appearance_handler.cc (left): > > https://codereview.chromium.org/1758013002/diff/140001/chrome/browser/ui/webui/settings/appearance_handler.cc#oldcode78 ...
4 years, 9 months ago (2016-03-03 20:00:57 UTC) #15
Dan Beam
On 2016/03/03 19:51:22, dpapad wrote: > ui/webui/resources/js/promise_resolver.js:20: function PromiseResolver() { > On 2016/03/03 at 19:04:51, ...
4 years, 9 months ago (2016-03-03 20:11:08 UTC) #18
dpapad
We could not use this PromiseResolver is print_preview, until after this CL (sine it was ...
4 years, 9 months ago (2016-03-03 20:18:53 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1758013002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1758013002/180001
4 years, 9 months ago (2016-03-03 20:22:10 UTC) #23
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 9 months ago (2016-03-03 21:57:00 UTC) #24
commit-bot: I haz the power
4 years, 9 months ago (2016-03-03 21:59:08 UTC) #26
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/8b4b5952c3259661772fb882053bbe67b9de2a67
Cr-Commit-Position: refs/heads/master@{#379104}

Powered by Google App Engine
This is Rietveld 408576698