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

Issue 10911020: Enable commands API for platform apps. (Closed)

Created:
8 years, 3 months ago by Marijn Kruisselbrink
Modified:
8 years, 3 months ago
CC:
chromium-reviews, jeremya+watch_chromium.org, mihaip-chromium-reviews_chromium.org, tfarina
Visibility:
Public.

Description

Enable commands API for platform apps. Also make sure that accelerators associated with commands are actually triggered when a ShellWindow is active. BUG=144434 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=155790

Patch Set 1 #

Patch Set 2 : fix a small style issue #

Patch Set 3 : only listen to the right keybindings in shellwindows #

Patch Set 4 : filter by extension type instead of specific extensions #

Total comments: 1

Patch Set 5 : rename to PLATFORMS_APPS_ONLY #

Total comments: 4

Patch Set 6 : fix nits #

Patch Set 7 : rebase #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+135 lines, -30 lines) Patch
M chrome/browser/extensions/extension_keybinding_registry.h View 1 2 3 4 2 chunks +16 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_keybinding_registry.cc View 1 2 3 4 5 chunks +37 lines, -15 lines 4 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa.mm View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h View 1 2 3 4 5 6 4 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm View 1 2 3 4 5 6 4 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/extensions/shell_window_gtk.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/extensions/shell_window_gtk.cc View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/browser_actions_container.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/extensions/extension_keybinding_registry_views.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/extensions/shell_window_views.h View 1 2 3 4 5 6 2 chunks +7 lines, -0 lines 1 comment Download
M chrome/browser/ui/views/extensions/shell_window_views.cc View 1 2 3 4 5 6 3 chunks +9 lines, -1 line 0 comments Download

Messages

Total messages: 24 (0 generated)
Marijn Kruisselbrink
Antony: can you review the chrome/common/extensions part? Evan: can you review the chrome/browser/ui/gtk part? rsesek: ...
8 years, 3 months ago (2012-08-30 22:00:35 UTC) #1
asargent_no_longer_on_chrome
chrome/common/extensions LGTM
8 years, 3 months ago (2012-08-30 23:14:27 UTC) #2
Mihai Parparita -not on Chrome
After thinking about this a bit more, I think it might make sense for the ...
8 years, 3 months ago (2012-08-30 23:31:15 UTC) #3
Marijn Kruisselbrink
On 2012/08/30 23:31:15, Mihai Parparita wrote: > After thinking about this a bit more, I ...
8 years, 3 months ago (2012-08-30 23:59:43 UTC) #4
Mihai Parparita -not on Chrome
On Thu, Aug 30, 2012 at 4:59 PM, <mek@chromium.org> wrote: > > If there is ...
8 years, 3 months ago (2012-08-31 00:07:31 UTC) #5
Mihai Parparita -not on Chrome
On Thu, Aug 30, 2012 at 4:59 PM, <mek@chromium.org> wrote: > > If there is ...
8 years, 3 months ago (2012-08-31 00:07:31 UTC) #6
Marijn Kruisselbrink
On 2012/08/31 00:07:31, Mihai Parparita wrote: > On Thu, Aug 30, 2012 at 4:59 PM, ...
8 years, 3 months ago (2012-08-31 16:34:02 UTC) #7
Marijn Kruisselbrink
I now added an extra const Extension* parameter to the ExtensionKeybindingRegistry, which when non-null is ...
8 years, 3 months ago (2012-08-31 22:19:45 UTC) #8
Mihai Parparita -not on Chrome
As discussed, it would be even better if commands registered by platform apps worked regardless ...
8 years, 3 months ago (2012-08-31 22:37:54 UTC) #9
Marijn Kruisselbrink
On 2012/08/31 22:37:54, Mihai Parparita wrote: > As discussed, it would be even better if ...
8 years, 3 months ago (2012-08-31 23:35:23 UTC) #10
Mihai Parparita -not on Chrome
LGTM, thanks, this is pretty much what I had in mind. https://chromiumcodereview.appspot.com/10911020/diff/4003/chrome/browser/extensions/extension_keybinding_registry.h File chrome/browser/extensions/extension_keybinding_registry.h (right): ...
8 years, 3 months ago (2012-09-04 22:09:45 UTC) #11
Aaron Boodman
On 2012/08/30 23:31:15, Mihai Parparita wrote: > 2. Commands registered by extensions apply to Chrome ...
8 years, 3 months ago (2012-09-04 23:09:38 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mek@chromium.org/10911020/13001
8 years, 3 months ago (2012-09-05 00:03:27 UTC) #13
commit-bot: I haz the power
Presubmit check for 10911020-13001 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 3 months ago (2012-09-05 00:03:35 UTC) #14
Robert Sesek
cocoa/ LGTM
8 years, 3 months ago (2012-09-05 15:14:52 UTC) #15
Evan Stade
just nits, otherwise lgtm http://codereview.chromium.org/10911020/diff/13001/chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc File chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc (right): http://codereview.chromium.org/10911020/diff/13001/chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc#newcode24 chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc:24: Profile* profile, gfx::NativeWindow window, every ...
8 years, 3 months ago (2012-09-05 21:38:27 UTC) #16
Marijn Kruisselbrink
http://codereview.chromium.org/10911020/diff/13001/chrome/browser/ui/gtk/extensions/shell_window_gtk.cc File chrome/browser/ui/gtk/extensions/shell_window_gtk.cc (right): http://codereview.chromium.org/10911020/diff/13001/chrome/browser/ui/gtk/extensions/shell_window_gtk.cc#newcode96 chrome/browser/ui/gtk/extensions/shell_window_gtk.cc:96: // Add the keybinding registry, now that the window ...
8 years, 3 months ago (2012-09-06 18:09:56 UTC) #17
Evan Stade
http://codereview.chromium.org/10911020/diff/13001/chrome/browser/ui/gtk/browser_window_gtk.cc File chrome/browser/ui/gtk/browser_window_gtk.cc (right): http://codereview.chromium.org/10911020/diff/13001/chrome/browser/ui/gtk/browser_window_gtk.cc#newcode1823 chrome/browser/ui/gtk/browser_window_gtk.cc:1823: // Add the keybinding registry, now that the window ...
8 years, 3 months ago (2012-09-06 18:20:22 UTC) #18
Ben Goodger (Google)
lgtm
8 years, 3 months ago (2012-09-10 15:42:59 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mek@chromium.org/10911020/11
8 years, 3 months ago (2012-09-10 16:18:33 UTC) #20
commit-bot: I haz the power
Failed to apply patch for chrome/browser/ui/gtk/extensions/shell_window_gtk.cc: While running patch -p1 --forward --force; patching file chrome/browser/ui/gtk/extensions/shell_window_gtk.cc ...
8 years, 3 months ago (2012-09-10 16:18:39 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mek@chromium.org/10911020/10004
8 years, 3 months ago (2012-09-10 16:46:57 UTC) #22
commit-bot: I haz the power
Change committed as 155790
8 years, 3 months ago (2012-09-10 19:11:22 UTC) #23
Finnur
8 years, 3 months ago (2012-09-11 10:29:42 UTC) #24
A bit late to the game -- I didn't see this CL until now.

Firstly, I'm not familiar with these shell window classes. Why do they need
keybindings and are there other types of windows we are missing?

https://chromiumcodereview.appspot.com/10911020/diff/10004/chrome/browser/ext...
File chrome/browser/extensions/extension_keybinding_registry.cc (right):

https://chromiumcodereview.appspot.com/10911020/diff/10004/chrome/browser/ext...
chrome/browser/extensions/extension_keybinding_registry.cc:41:
AddExtensionKeybinding(*iter, std::string());
nit: This is now multiline and needs braces.

https://chromiumcodereview.appspot.com/10911020/diff/10004/chrome/browser/ext...
chrome/browser/extensions/extension_keybinding_registry.cc:89: }
I'm a little worried about the fact that this class was originally intended to
be completely in sync with other such classes (on the same platform). You'd
always get the same answer no matter what window was checking the registry, but
now the registry contains different shortcut assignments based on which type of
window it belongs to.

Now it seems that platform-app windows only know about platform-app shortcuts,
but other windows know about all shortcuts. Can that lead to problems?

What happens (or should happen) when you hit a platform-app-specific keyboard
shortcut in a non-platform-app window?

And similar for the reverse, should a keyboard shortcut for a regular extension
(non-platform app) be ignored when struck while a platform-app window has focus?

Also (thinking out loud here), lets assume you have an extension (not a
platform-app) register Ctrl+Y and then you install a platform-app that also
wants Ctrl+Y. I think AssignInitialKeybinding will do the right thing and not
override the Pref keybinding for the non-platform-app extension. Correct? Then,
the platform-app shortcut becomes inactive at install time, because another one
has taken Ctrl+Y? That's expected, right?

And finally, how should this work in the config UI? I assume platform apps can
only have named commands specified (not browser/page actions) and that those
just get listed and you can assign a shortcut from a platform app to a
non-platform app and vice versa, without problems. Correct?

https://chromiumcodereview.appspot.com/10911020/diff/10004/chrome/browser/ext...
chrome/browser/extensions/extension_keybinding_registry.cc:100: {
nit: Should be on the line above.

https://chromiumcodereview.appspot.com/10911020/diff/10004/chrome/browser/ext...
chrome/browser/extensions/extension_keybinding_registry.cc:107: NOTREACHED();
For enum types it is better to leave out the default clause because then you'll
get a compile error on non-Windows platforms when a new enum value is added and
they forget to update this switch statement to account for it.

https://chromiumcodereview.appspot.com/10911020/diff/10004/chrome/browser/ui/...
File chrome/browser/ui/views/extensions/shell_window_views.h (right):

https://chromiumcodereview.appspot.com/10911020/diff/10004/chrome/browser/ui/...
chrome/browser/ui/views/extensions/shell_window_views.h:128:
UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
nit: Maybe document why we need this?

Powered by Google App Engine
This is Rietveld 408576698