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

Side by Side Diff: chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.cc

Issue 1636243002: Eat all keys involving Search when ChromeVox is on and add a pass through mode command. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Track key up. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.h " 5 #include "chrome/browser/chromeos/accessibility/spoken_feedback_event_rewriter.h "
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 return false; 46 return false;
47 47
48 extensions::ExtensionHost* host = 48 extensions::ExtensionHost* host =
49 extensions::ProcessManager::Get(context) 49 extensions::ProcessManager::Get(context)
50 ->GetBackgroundHostForExtension(extension->id()); 50 ->GetBackgroundHostForExtension(extension->id());
51 if (!host) 51 if (!host)
52 return false; 52 return false;
53 53
54 content::RenderViewHost* rvh = host->render_view_host(); 54 content::RenderViewHost* rvh = host->render_view_host();
55 55
56 // Always capture the Search key.
57 capture |= key_event.IsCommandDown();
58
56 // Listen for any unhandled keyboard events from ChromeVox's background page 59 // Listen for any unhandled keyboard events from ChromeVox's background page
57 // when capturing keys to reinject. 60 // when capturing keys to reinject.
58 if (capture) 61 if (capture)
59 host->host_contents()->SetDelegate(this); 62 host->host_contents()->SetDelegate(this);
60 else 63 else
61 host->host_contents()->SetDelegate(nullptr); 64 host->host_contents()->SetDelegate(nullptr);
62 65
63 // Forward all key events to ChromeVox's background page. 66 // Forward all key events to ChromeVox's background page.
64 const content::NativeWebKeyboardEvent web_event(key_event); 67 const content::NativeWebKeyboardEvent web_event(key_event);
65 rvh->GetWidget()->ForwardKeyboardEvent(web_event); 68 rvh->GetWidget()->ForwardKeyboardEvent(web_event);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 if (delegate_->DispatchKeyEventToChromeVox(key_event, capture)) 140 if (delegate_->DispatchKeyEventToChromeVox(key_event, capture))
138 return ui::EVENT_REWRITE_DISCARD; 141 return ui::EVENT_REWRITE_DISCARD;
139 return ui::EVENT_REWRITE_CONTINUE; 142 return ui::EVENT_REWRITE_CONTINUE;
140 } 143 }
141 144
142 ui::EventRewriteStatus SpokenFeedbackEventRewriter::NextDispatchEvent( 145 ui::EventRewriteStatus SpokenFeedbackEventRewriter::NextDispatchEvent(
143 const ui::Event& last_event, 146 const ui::Event& last_event,
144 scoped_ptr<ui::Event>* new_event) { 147 scoped_ptr<ui::Event>* new_event) {
145 return ui::EVENT_REWRITE_CONTINUE; 148 return ui::EVENT_REWRITE_CONTINUE;
146 } 149 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698