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

Issue 1185753008: Proposed alternative for supporting ChromeVox keyboard commands. (Closed)

Created:
5 years, 6 months ago by David Tseng
Modified:
5 years, 6 months ago
CC:
chromium-reviews, oshima+watch_chromium.org, plundblad+watch_chromium.org, aboxhall+watch_chromium.org, nektar+watch_chromium.org, yuzo+watch_chromium.org, je_julie, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Proposed alternative for supporting ChromeVox keyboard commands. ChromeVox, a component extension, has some special use cases not currently supported by the chrome.commands API. Over the past year or so, it has become more clear that these special use cases mean non-trivial changes to the commands API. These changes have also uncovered some bugs due to (a) component extension events and (b) prefs. This is a proposed simple alternative which still utilizes the same manifest format as the commands API and the same extension listener, but performs its own dispatch. It also need not register accelerators in advance as it hooks into keyboard events via EventRewriter. This solution has some advantages. It means that we can swap the format and use keys not allowed by the commands API. Also, we can implement more features such as sequencing, or sticky key natively. Some disadvantages are it will interfere with Chrome OS sticky keys and is Chrome OS specific. TEST=ensure chrome.commands.onCommand gets called with appropriate command name when keys are struck on OOBE, locked screen, login screen, and logged in. Committed: https://crrev.com/a97769b865c7a511229d2eee04051d59200bf1b3 Cr-Commit-Position: refs/heads/master@{#335997}

Patch Set 1 : #

Total comments: 4

Patch Set 2 : Restrict to browser context and return on null extension. #

Total comments: 2

Patch Set 3 : Discard some release events. #

Patch Set 4 : Add tests. #

Total comments: 8

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Total comments: 8

Patch Set 8 : Remove ui/events/* changes. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+335 lines, -0 lines) Patch
A chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.h View 1 2 3 4 5 1 chunk +63 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc View 1 2 3 4 5 6 7 1 chunk +120 lines, -0 lines 4 comments Download
A chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc View 1 2 3 4 5 6 7 1 chunk +146 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/chrome_browser_main_chromeos.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 37 (9 generated)
David Tseng
5 years, 6 months ago (2015-06-15 19:28:34 UTC) #2
Finnur
Interesting approach. I have on occasion wondered if the Commands API was in fact flexible ...
5 years, 6 months ago (2015-06-16 11:29:49 UTC) #6
David Tseng
+ oshima for OWNERS and any other commentary. dmazzoni for accessibility/ChromeVox bits. Thanks finnur for ...
5 years, 6 months ago (2015-06-16 15:31:37 UTC) #8
dmazzoni
I agree that we should add some custom logic for routing key events to ChromeVox. ...
5 years, 6 months ago (2015-06-16 16:30:56 UTC) #9
David Tseng
On Tue, Jun 16, 2015 at 9:30 AM, <dmazzoni@chromium.org> wrote: Why will sticky keys break? ...
5 years, 6 months ago (2015-06-16 16:52:36 UTC) #10
David Tseng
On Tue, Jun 16, 2015 at 9:52 AM, David Tseng <dtseng@chromium.org> wrote: > > > ...
5 years, 6 months ago (2015-06-16 16:55:37 UTC) #11
David Tseng
On Tue, Jun 16, 2015 at 9:55 AM, David Tseng <dtseng@chromium.org> wrote: On Tue, Jun ...
5 years, 6 months ago (2015-06-16 17:00:01 UTC) #12
David Tseng
https://codereview.chromium.org/1185753008/diff/80001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc File chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc (right): https://codereview.chromium.org/1185753008/diff/80001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc#newcode29 chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc:29: event.type() != ui::ET_KEY_PRESSED || On 2015/06/16 16:30:56, dmazzoni wrote: ...
5 years, 6 months ago (2015-06-17 22:22:11 UTC) #13
dmazzoni
> > If you discard a press event, I think the release gets discarded. > ...
5 years, 6 months ago (2015-06-18 16:44:11 UTC) #14
David Tseng
PTAL. I now track modifiers that are held at the time of a discarded event ...
5 years, 6 months ago (2015-06-22 19:04:42 UTC) #15
dmazzoni
Overall looks good, just a thought about testing. On 2015/06/22 19:04:42, David Tseng wrote: > ...
5 years, 6 months ago (2015-06-22 20:35:38 UTC) #16
David Tseng
PTAL. Tests added. On Mon, Jun 22, 2015 at 1:35 PM, <dmazzoni@chromium.org> wrote: > Overall ...
5 years, 6 months ago (2015-06-23 17:02:55 UTC) #17
dmazzoni
The delegate looks great. Just one more suggestion there - I probably would have provided ...
5 years, 6 months ago (2015-06-23 17:11:18 UTC) #18
David Tseng
https://codereview.chromium.org/1185753008/diff/120001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc File chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc (right): https://codereview.chromium.org/1185753008/diff/120001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc#newcode88 chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc:88: // Send Search+Shift+Right. On 2015/06/23 17:11:17, dmazzoni wrote: > ...
5 years, 6 months ago (2015-06-23 17:51:29 UTC) #19
dmazzoni
lgtm
5 years, 6 months ago (2015-06-23 18:25:11 UTC) #20
David Tseng
+ sadrul for ui/events and oshima for chrome/browser/chromeos/chrome_browser_main_chromeos.cc
5 years, 6 months ago (2015-06-23 19:51:20 UTC) #22
sadrul
https://codereview.chromium.org/1185753008/diff/180001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc File chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc (right): https://codereview.chromium.org/1185753008/diff/180001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc#newcode48 chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc:48: generator_->AddEventRewriter(spoken_feedback_event_rewriter_.get()); Can this just do CurrentContext()->GetHost()->GetEventSource() to get the ...
5 years, 6 months ago (2015-06-24 18:31:02 UTC) #23
David Tseng
Thanks sadrul; no longer requires your approval. https://codereview.chromium.org/1185753008/diff/180001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc File chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc (right): https://codereview.chromium.org/1185753008/diff/180001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc#newcode48 chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter_unittest.cc:48: generator_->AddEventRewriter(spoken_feedback_event_rewriter_.get()); On ...
5 years, 6 months ago (2015-06-24 19:09:54 UTC) #24
oshima
lgtm
5 years, 6 months ago (2015-06-24 19:37:40 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1185753008/200001
5 years, 6 months ago (2015-06-24 20:45:47 UTC) #28
commit-bot: I haz the power
Committed patchset #8 (id:200001)
5 years, 6 months ago (2015-06-24 20:51:24 UTC) #29
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/a97769b865c7a511229d2eee04051d59200bf1b3 Cr-Commit-Position: refs/heads/master@{#335997}
5 years, 6 months ago (2015-06-24 20:53:13 UTC) #30
stevenjb
https://codereview.chromium.org/1185753008/diff/200001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc File chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc (right): https://codereview.chromium.org/1185753008/diff/200001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc#newcode109 chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc:109: if (delegate_->DispatchKeyToChromeVox(key_event)) { We are seeing a crash in ...
5 years, 6 months ago (2015-06-25 16:10:14 UTC) #32
stevenjb
A revert of this CL (patchset #8 id:200001) has been created in https://codereview.chromium.org/1211003002/ by stevenjb@chromium.org. ...
5 years, 6 months ago (2015-06-25 16:31:44 UTC) #33
David Tseng
https://codereview.chromium.org/1185753008/diff/200001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc File chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc (right): https://codereview.chromium.org/1185753008/diff/200001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc#newcode109 chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc:109: if (delegate_->DispatchKeyToChromeVox(key_event)) { On 2015/06/25 16:10:14, stevenjb wrote: > ...
5 years, 6 months ago (2015-06-25 16:44:06 UTC) #34
oshima
https://codereview.chromium.org/1185753008/diff/200001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc File chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc (right): https://codereview.chromium.org/1185753008/diff/200001/chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc#newcode109 chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc:109: if (delegate_->DispatchKeyToChromeVox(key_event)) { On 2015/06/25 16:44:06, David Tseng wrote: ...
5 years, 6 months ago (2015-06-25 17:02:37 UTC) #35
stevenjb
See http://crbug.com/504400 (And let's continue any discussion there) On Thu, Jun 25, 2015 at 11:02 ...
5 years, 6 months ago (2015-06-25 17:09:25 UTC) #36
oshima
5 years, 6 months ago (2015-06-25 17:13:37 UTC) #37
Message was sent while issue was closed.
https://codereview.chromium.org/1185753008/diff/200001/chrome/browser/chromeo...
File chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc
(right):

https://codereview.chromium.org/1185753008/diff/200001/chrome/browser/chromeo...
chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc:109: if
(delegate_->DispatchKeyToChromeVox(key_event)) {
On 2015/06/25 17:02:37, oshima wrote:
> On 2015/06/25 16:44:06, David Tseng wrote:
> > On 2015/06/25 16:10:14, stevenjb wrote:
> > > We are seeing a crash in DispatchKeyToChromeVox when it calls
> > > ProfileManager::GetLastUsedProfile when called from here. Here is a crash:
> > > 
> > >
> >
>
https://00e9e64bac9e55b1ad3bc989f7fe6755e50c3d830bde6537f1-apidata.googleuser...
> > > 
> > > I am going to file an issue for this, and will try to use cbuildbot to
> > confirm,
> > > but if you can think how this might happen after the Profile has been
> > destroyed,
> > > we should revert this.
> > 
> > According to the stack, it looks like the call to
> > ProfileManager::GetLastUsedProfile eventually calls
> > ProfileManager::CreateAndInitializeProfile which causes an out of memory
> error.
> > Oshima, any comments on this particular theory?
> 
> I couldn't access the stack info. Can you post it here?

My guess is that this is called before profiles are fully loaded.

I don't know why CreateAndInitializeProfile crashes, but I think you shouldn't
call this unless
profiles are loaded anyway. There is NOTIFICATION_PROFILE_ADDED notification, so
you can try that.
(I'm not sure if this is called for login profile. you may need different way to
wire this up if not)

Powered by Google App Engine
This is Rietveld 408576698