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

Issue 2928723002: [iOS Clean] Added JavaScript dialog support.

Created:
3 years, 6 months ago by kkhorimoto
Modified:
3 years, 6 months ago
CC:
chromium-reviews, marq+scrutinize_chromium.org, ios-reviews+clean_chromium.org, ios-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[iOS Clean] Added JavaScript dialog support. This CL adds a coordinator managing a DialogViewController that displays JavaScript dialogs. BUG=none

Patch Set 1 #

Patch Set 2 : rebased, subclassed DialogMediator #

Total comments: 6

Patch Set 3 : rebase & Mark's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+623 lines, -0 lines) Patch
M ios/clean/chrome/browser/ui/commands/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/commands/java_script_dialog_commands.h View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
M ios/clean/chrome/browser/ui/dialogs/BUILD.gn View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/BUILD.gn View 1 2 1 chunk +34 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/java_script_dialog_coordinator.h View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/java_script_dialog_coordinator.mm View 1 2 1 chunk +92 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/java_script_dialog_mediator.h View 1 2 1 chunk +29 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/java_script_dialog_mediator.mm View 1 2 1 chunk +134 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/java_script_dialog_overlay_presenter.h View 1 2 1 chunk +51 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/java_script_dialog_overlay_presenter.mm View 1 2 1 chunk +64 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/java_script_dialog_request.h View 1 2 1 chunk +57 lines, -0 lines 0 comments Download
A ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/java_script_dialog_request.mm View 1 2 1 chunk +104 lines, -0 lines 0 comments Download
M ios/clean/chrome/browser/ui/web_contents/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm View 1 2 2 chunks +8 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 6 (1 generated)
kkhorimoto
3 years, 6 months ago (2017-06-07 08:02:45 UTC) #2
kkhorimoto
rebased, subclassed DialogMediator
3 years, 6 months ago (2017-06-08 00:42:27 UTC) #3
marq (ping after 24h)
All of the comments about HTTP dialogs apply here, too. https://codereview.chromium.org/2928723002/diff/20001/ios/clean/chrome/browser/ui/commands/java_script_dialog_commands.h File ios/clean/chrome/browser/ui/commands/java_script_dialog_commands.h (right): https://codereview.chromium.org/2928723002/diff/20001/ios/clean/chrome/browser/ui/commands/java_script_dialog_commands.h#newcode18 ...
3 years, 6 months ago (2017-06-14 11:28:40 UTC) #4
kkhorimoto
rebase & Mark's comments
3 years, 6 months ago (2017-06-23 06:29:16 UTC) #5
kkhorimoto
3 years, 6 months ago (2017-06-23 06:34:03 UTC) #6
https://codereview.chromium.org/2928723002/diff/20001/ios/clean/chrome/browse...
File ios/clean/chrome/browser/ui/commands/java_script_dialog_commands.h (right):

https://codereview.chromium.org/2928723002/diff/20001/ios/clean/chrome/browse...
ios/clean/chrome/browser/ui/commands/java_script_dialog_commands.h:18: // input
in the prompt.
On 2017/06/14 11:28:39, marq (ping after 24h) wrote:
> Should the API distinguish between the user entering nothing in the prompt and
> selecting "OK", or selecting "Cancel"?
> 
> Document that |result| is always nil if the user selected "Cancel".

Added documentation to JavaScriptDialogRequest's
|-finishRequestWithSuccess:userInput:|.

https://codereview.chromium.org/2928723002/diff/20001/ios/clean/chrome/browse...
File
ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/web_java_script_dialog_presenter.h
(right):

https://codereview.chromium.org/2928723002/diff/20001/ios/clean/chrome/browse...
ios/clean/chrome/browser/ui/dialogs/java_script_dialogs/web_java_script_dialog_presenter.h:15:
class WebJavaScriptDialogPresenter
On 2017/06/14 11:28:39, marq (ping after 24h) wrote:
> I suspect naming this "WebFoo" when it isn't in ios/web/ might be confusing.
I'm
> out of suggestions, though.

I'm also not a fan. I renamed it to JavaScriptDialogOverlayPresenter, which at
least isn't OBVIOUSLY to avoid naming collisions, but having an *Impl subclass
would be preferable in the long run.

https://codereview.chromium.org/2928723002/diff/20001/ios/clean/chrome/browse...
File ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm (right):

https://codereview.chromium.org/2928723002/diff/20001/ios/clean/chrome/browse...
ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm:157:
WebJavaScriptDialogPresenter::CreateForWebState(self.webState);
On 2017/06/14 11:28:39, marq (ping after 24h) wrote:
> This implies the presenter will be created when an HTTP dialog is created,
which
> seems incorrect.

This function doesn't exist anymore since the OverlayQueue is automatically
instantiated by the OverlayService.  Instead, CreateForWebState() is called
directly in |-javaScriptDialogPresenterForWebState:|

Powered by Google App Engine
This is Rietveld 408576698