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

Issue 10134036: Let Chrome app handle Ash accelerators first if the app is launched as a window (Closed)

Created:
8 years, 8 months ago by Yusuke Sato
Modified:
8 years, 7 months ago
CC:
chromium-reviews, sadrul, ben+watch_chromium.org, Wez, content-team_chromium.org
Visibility:
Public.

Description

Let Chrome app handle Ash accelerators first if the app is launched as a window. Currently, Ash accelerators are handled at a very early stage, right after a native key event is received by aura::RootWindowHost. This CL change the way of handling Ash accelerators as follows to make it more App friendly: 1. If no window is focused, handle an Ash accelerator immediately in ash/accelerators/accelerator_filter.cc in the same way as before. 2. Otherwise, do not handle it in ash/accelerators/accelerator_filter.cc but let a custom views::FocusManager handle it (see ash/shell.cc). There are 3 types of scenarios here depending on the type of the focused window: 2-a. If the focused window is a browser, and the browser is not for an app, let the custom focus manager pre-handle Ash accelerators before passing it to the browser (see PreHandleKeyboardEvent() in chrome/browser/ui/views/frame/browser_view.cc). 2-b. If the focused window is a browser, and the browser is for an app, let the app handle Ash accelerators first (see chrome/browser/ui/views/frame/browser_view.cc). If the accelerator is not consumed by the app, let the custom focus manager handle it. 2-c. If the focused window is not a browser, let the window handle Ash accelerators first. If the accelerator is not consumed by the window, then let the custom focus manager handle it. This means a WebView without the chrome/browser/ui/ layer can handle Ash accelerators first whenever needed. Other changes: chrome/browser/ui/views/frame/browser_view.cc: Support ET_KEY_RELEASED accelerators in BrowserView::PreHandleKeyboardEvent(). ui/views/focus/focus_manager.cc: Support ET_KEY_RELEASED accelerators. Also fix code for handing VKEY_MENU so that the Shift+Alt+ET_KEY_RELEASED accelerator for Ash could be handled correctly. This CL depends on http://codereview.chromium.org/10377158/ (by jochen), https://chromiumcodereview.appspot.com/10388023, http://codereview.chromium.org/10389035/, and https://chromiumcodereview.appspot.com/10332051/, and should not be submitted until the 4 CLs are landed. BUG=123856 TEST=ran aura_shell_unittests TEST=manual; launch Chromoting app as a window, connect to a Chromoting server, focus Chrome on the remote machine, press Ctrl-n, confirm a new window is opened on the remote machine. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=135791 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=137629

Patch Set 1 #

Patch Set 2 : wip #

Patch Set 3 : review #

Total comments: 8

Patch Set 4 : addressed comments #

Patch Set 5 : rebase, fix interactive_ui_tests #

Patch Set 6 : stopped special-casing browser windows, rebase #

Patch Set 7 : fix tests #

Total comments: 6

Patch Set 8 : add FocusManagerDelegate, remove |target| checking #

Patch Set 9 : style fix #

Total comments: 4

Patch Set 10 : rebase, address review comments #

Patch Set 11 : 2nd try #

Total comments: 2

Patch Set 12 : revert content/ changes #

Patch Set 13 : final rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+284 lines, -96 lines) Patch
M ash/accelerators/accelerator_controller.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M ash/accelerators/accelerator_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -0 lines 0 comments Download
M ash/accelerators/accelerator_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +11 lines, -0 lines 0 comments Download
M ash/accelerators/accelerator_filter.cc View 1 2 3 4 5 2 chunks +15 lines, -0 lines 0 comments Download
M ash/accelerators/accelerator_filter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +5 lines, -16 lines 0 comments Download
A ash/accelerators/focus_manager_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +43 lines, -0 lines 0 comments Download
A ash/accelerators/focus_manager_factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +40 lines, -0 lines 0 comments Download
M ash/ash.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M ash/shell.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +8 lines, -15 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +36 lines, -16 lines 0 comments Download
M ui/views/focus/focus_manager.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -1 line 0 comments Download
M ui/views/focus/focus_manager.cc View 1 2 3 4 5 6 7 8 6 chunks +60 lines, -45 lines 0 comments Download
A ui/views/focus/focus_manager_delegate.h View 1 2 3 4 5 6 7 8 9 1 chunk +40 lines, -0 lines 0 comments Download
M ui/views/focus/focus_manager_factory.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/focus/focus_manager_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ui/views/views.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
Yusuke Sato
8 years, 7 months ago (2012-05-01 10:29:53 UTC) #1
Ben Goodger (Google)
https://chromiumcodereview.appspot.com/10134036/diff/7013/ash/accelerators/accelerator_controller.h File ash/accelerators/accelerator_controller.h (right): https://chromiumcodereview.appspot.com/10134036/diff/7013/ash/accelerators/accelerator_controller.h#newcode60 ash/accelerators/accelerator_controller.h:60: bool IsAccelerator(const ui::Accelerator& accelerator); IsRegistered()? https://chromiumcodereview.appspot.com/10134036/diff/7013/ash/shell_delegate.h File ash/shell_delegate.h (right): ...
8 years, 7 months ago (2012-05-01 16:00:37 UTC) #2
Yusuke Sato
It seems that some of interactive_ui_tests for linux_chromeos are red and I have to fix ...
8 years, 7 months ago (2012-05-02 16:40:11 UTC) #3
Yusuke Sato
On 2012/05/02 16:40:11, Yusuke Sato wrote: > It seems that some of interactive_ui_tests for linux_chromeos ...
8 years, 7 months ago (2012-05-03 15:56:24 UTC) #4
Ben Goodger (Google)
http://codereview.chromium.org/10134036/diff/7013/ash/shell_delegate.h File ash/shell_delegate.h (right): http://codereview.chromium.org/10134036/diff/7013/ash/shell_delegate.h#newcode63 ash/shell_delegate.h:63: virtual bool IsBrowserWindow(const aura::Window* window) = 0; On 2012/05/02 ...
8 years, 7 months ago (2012-05-03 17:29:38 UTC) #5
Yusuke Sato
On 2012/05/03 17:29:38, Ben Goodger (Google) wrote: > http://codereview.chromium.org/10134036/diff/7013/ash/shell_delegate.h > File ash/shell_delegate.h (right): > > ...
8 years, 7 months ago (2012-05-03 17:41:37 UTC) #6
Yusuke Sato
http://codereview.chromium.org/10134036/diff/7013/ash/shell_delegate.h File ash/shell_delegate.h (right): http://codereview.chromium.org/10134036/diff/7013/ash/shell_delegate.h#newcode63 ash/shell_delegate.h:63: virtual bool IsBrowserWindow(const aura::Window* window) = 0; On 2012/05/03 ...
8 years, 7 months ago (2012-05-03 17:45:58 UTC) #7
Ben Goodger (Google)
On 2012/05/03 17:45:58, Yusuke Sato wrote: > > Why do you need to know if ...
8 years, 7 months ago (2012-05-03 22:22:30 UTC) #8
Yusuke Sato
On 2012/05/03 22:22:30, Ben Goodger (Google) wrote: > On 2012/05/03 17:45:58, Yusuke Sato wrote: > ...
8 years, 7 months ago (2012-05-04 12:51:39 UTC) #9
Ben Goodger (Google)
http://codereview.chromium.org/10134036/diff/44013/ash/shell.cc File ash/shell.cc (right): http://codereview.chromium.org/10134036/diff/44013/ash/shell.cc#newcode512 ash/shell.cc:512: #if !defined(OS_MACOSX) why the OS_MACOSX? http://codereview.chromium.org/10134036/diff/44013/ash/shell.cc#newcode525 ash/shell.cc:525: target); This ...
8 years, 7 months ago (2012-05-04 16:25:33 UTC) #10
Yusuke Sato
Please take another look. http://codereview.chromium.org/10134036/diff/44013/ash/shell.cc File ash/shell.cc (right): http://codereview.chromium.org/10134036/diff/44013/ash/shell.cc#newcode512 ash/shell.cc:512: #if !defined(OS_MACOSX) On 2012/05/04 16:25:33, ...
8 years, 7 months ago (2012-05-07 08:27:28 UTC) #11
Ben Goodger (Google)
lgtm http://codereview.chromium.org/10134036/diff/46029/ash/shell.cc File ash/shell.cc (right): http://codereview.chromium.org/10134036/diff/46029/ash/shell.cc#newcode505 ash/shell.cc:505: class AshFocusManagerFactory : public views::FocusManagerFactory { Can we ...
8 years, 7 months ago (2012-05-07 15:42:51 UTC) #12
Yusuke Sato
http://codereview.chromium.org/10134036/diff/46029/ash/shell.cc File ash/shell.cc (right): http://codereview.chromium.org/10134036/diff/46029/ash/shell.cc#newcode505 ash/shell.cc:505: class AshFocusManagerFactory : public views::FocusManagerFactory { On 2012/05/07 15:42:51, ...
8 years, 7 months ago (2012-05-08 02:15:57 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yusukes@chromium.org/10134036/38016
8 years, 7 months ago (2012-05-08 03:40:22 UTC) #14
commit-bot: I haz the power
Try job failure for 10134036-38016 on win_rel for step "update". http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=26679 Step "update" is always ...
8 years, 7 months ago (2012-05-08 04:03:05 UTC) #15
Yusuke Sato
Ben, could you take another look? I've fixed the following issues of Patch Set #10: ...
8 years, 7 months ago (2012-05-10 15:44:17 UTC) #16
Yusuke Sato
ping? On 2012/05/10 15:44:17, Yusuke Sato wrote: > Ben, could you take another look? I've ...
8 years, 7 months ago (2012-05-14 08:07:02 UTC) #17
Ben Goodger (Google)
http://codereview.chromium.org/10134036/diff/49016/ash/accelerators/render_widget_host_factory.h File ash/accelerators/render_widget_host_factory.h (right): http://codereview.chromium.org/10134036/diff/49016/ash/accelerators/render_widget_host_factory.h#newcode10 ash/accelerators/render_widget_host_factory.h:10: #include "content/browser/renderer_host/render_widget_host_factory.h" You're not allowed to include from anything ...
8 years, 7 months ago (2012-05-14 17:10:55 UTC) #18
Yusuke Sato
+jam, +content-team http://codereview.chromium.org/10134036/diff/49016/ash/accelerators/render_widget_host_factory.h File ash/accelerators/render_widget_host_factory.h (right): http://codereview.chromium.org/10134036/diff/49016/ash/accelerators/render_widget_host_factory.h#newcode10 ash/accelerators/render_widget_host_factory.h:10: #include "content/browser/renderer_host/render_widget_host_factory.h" On 2012/05/14 17:10:56, Ben Goodger ...
8 years, 7 months ago (2012-05-15 02:15:19 UTC) #19
jochen (gone - plz use gerrit)
I would propose to add a RenderWidgetHostDelegate (there's already an implicit definition for it in ...
8 years, 7 months ago (2012-05-15 09:33:59 UTC) #20
jam
On 2012/05/15 09:33:59, jochen wrote: > I would propose to add a RenderWidgetHostDelegate (there's already ...
8 years, 7 months ago (2012-05-15 17:07:24 UTC) #21
jochen (gone - plz use gerrit)
On Tue, May 15, 2012 at 7:07 PM, <jam@chromium.org> wrote: > On 2012/05/15 09:33:59, jochen ...
8 years, 7 months ago (2012-05-15 17:56:05 UTC) #22
Yusuke Sato
Ben, could you take another look? Since the full-screen Pepper issue will be fixed by ...
8 years, 7 months ago (2012-05-16 11:12:17 UTC) #23
Ben Goodger (Google)
LGTM, but can you please make a set of diagrams showing the flow of accelerators ...
8 years, 7 months ago (2012-05-16 16:41:40 UTC) #24
Yusuke Sato
On 2012/05/16 16:41:40, Ben Goodger (Google) wrote: > LGTM, but can you please make a ...
8 years, 7 months ago (2012-05-17 02:22:04 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yusukes@chromium.org/10134036/51026
8 years, 7 months ago (2012-05-17 02:28:04 UTC) #26
commit-bot: I haz the power
8 years, 7 months ago (2012-05-17 04:42:38 UTC) #27
Change committed as 137629

Powered by Google App Engine
This is Rietveld 408576698