Hi all, this is a small change around calling FocusFailed in the case of RWHV destruction. Would appreciate a look when you get the chance.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
LGTM. Is this testable? Seems like it would be hard to test, but would be nice to have something.
if (StylusHandwritingControllerWin::IsHandwritingAPIAvailable() &&
StylusHandwritingControllerWin::GetInstance()
->IsWaitingForFocusResult()) {Do you have to null-check this controller or is it a certainty that `GetInstance` will return an object?
It also seems like `GetInstance` is being called regardless of false return in `IsHandwritingAPIAvailable`, which is making the tests hit a CHECK.
```suggestion
if (StylusHandwritingControllerWin::IsHandwritingAPIAvailable()) {
if (StylusHandwritingControllerWin::GetInstance() && // if you need to null check
StylusHandwritingControllerWin::GetInstance()
->IsWaitingForFocusResult()) {
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
API ie. TSF that focus has failed if RenderWidgetHostView is destroyedCan we have tests for this scenario?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
API ie. TSF that focus has failed if RenderWidgetHostView is destroyedCan we have tests for this scenario?
Sure I'll write some tests.
if (StylusHandwritingControllerWin::IsHandwritingAPIAvailable() &&
StylusHandwritingControllerWin::GetInstance()
->IsWaitingForFocusResult()) {Do you have to null-check this controller or is it a certainty that `GetInstance` will return an object?
It also seems like `GetInstance` is being called regardless of false return in `IsHandwritingAPIAvailable`, which is making the tests hit a CHECK.
```suggestion
if (StylusHandwritingControllerWin::IsHandwritingAPIAvailable()) {
if (StylusHandwritingControllerWin::GetInstance() && // if you need to null check
StylusHandwritingControllerWin::GetInstance()
->IsWaitingForFocusResult()) {
```
We have to null check the controller is initialized on hover with stylus. If that never happens, then GetInstance can be nullptr.
I believe the issue in CQ is just because I didn't check IsHandwritingAPIAvailable in RWHVA. Fixing that.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
API ie. TSF that focus has failed if RenderWidgetHostView is destroyedJohn AnCan we have tests for this scenario?
Sure I'll write some tests.
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi Jon, here's the follow up CL for OnFocusFailed fixups.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool StylusHandwritingControllerWin::IsWaitingForFocusResult() const {
return handwriting_callback_sink_ &&
handwriting_callback_sink_->IsFocusHandwritingTargetPending();Do we have a way to know what RWHV was the focus or potential candidate for handwriting recognition?
Currently the teardown of any RWHV would cancel the handwriting, even if it wasn't the target.
Consider two open windows. User starts handwriting in one, and taps to close the other
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
bool StylusHandwritingControllerWin::IsWaitingForFocusResult() const {
return handwriting_callback_sink_ &&
handwriting_callback_sink_->IsFocusHandwritingTargetPending();Do we have a way to know what RWHV was the focus or potential candidate for handwriting recognition?
Currently the teardown of any RWHV would cancel the handwriting, even if it wasn't the target.
Consider two open windows. User starts handwriting in one, and taps to close the other
This is legit. It's not possible to touch close during ongoing pen interaction on windows, but this is technically possible with window close on timeout. Performed refactor that allows for this and added tests.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi folks, Jon Ross was reviewing this until he went OOO. Would someone mind taking a look or adding an owner?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
#if BUILDFLAG(IS_WIN)Why is this replicated both in child frame and aura, wouldn't this just go in base?
base::WeakPtr<RenderWidgetHostViewBase> view,I'd prefer if was passed as a RenderWidgetHostViewBase* and then the WeakPtr was taken inside where the storage happened. (GetWeakPtr() is available as a public on RenderWidgetHostViewBase from my understanding).
Can we name this StartStylusWritingFromChildHostView(RenderWidgetHostViewBase* child_view...);
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
StylusHandwritingControllerWin::GetInstance()->OnFocusFailed();Would it be useful to pass back the RenderWidgetHostViewBase on the FocusFailed call?
dtapuska@ is the right owner for this. You don't need me, especially for input related code.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Why is this replicated both in child frame and aura, wouldn't this just go in base?
Had it this way because controller mgmt logic is located in those files. It's not a big deal to me to put it in the base so I can do that as well.
I'd prefer if was passed as a RenderWidgetHostViewBase* and then the WeakPtr was taken inside where the storage happened. (GetWeakPtr() is available as a public on RenderWidgetHostViewBase from my understanding).
Can we name this StartStylusWritingFromChildHostView(RenderWidgetHostViewBase* child_view...);
Sure that sounds good
StylusHandwritingControllerWin::GetInstance()->OnFocusFailed();Would it be useful to pass back the RenderWidgetHostViewBase on the FocusFailed call?
There's no need to validate the view that is invoking OnFocusFailed/Handled. If pending_target_args_ is set, then the check in OnHandwritingViewDestroyed will prevent an unrelated view from causing the session to fail. If it is not set, the methods will no-op.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |