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

Issue 10201016: Conflict detection for Extension Keybinding. (Closed)

Created:
8 years, 8 months ago by Finnur
Modified:
8 years, 7 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip+watch_chromium.org
Visibility:
Public.

Description

Conflict detection for Extension Keybinding. At install time, the extension will now try to make its suggested keybindings active. If the keybinding is free, then the extension is successful (before this CL the last registered extension would win). If the keybinding is not free, the keybinding becomes inactive. I've introduced a pref that keeps track of which keybinding is active, which will become the basis for a config UI. This changelist also fixes a DCHECK on close of Chrome if an extension with a keybinding has been uninstalled (we were unregistering twice). BUG=121419 TEST=Covered in automated test. (Install two extensions with the same keybinding. Only the first should get its keybinding activated). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=135115

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 23

Patch Set 5 : #

Patch Set 6 : Forgot to add extension.cc to the cl #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 27

Patch Set 9 : Uploaded after gclient sync, should be no change #

Patch Set 10 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+579 lines, -32 lines) Patch
A chrome/browser/extensions/extension_command_service.h View 1 2 3 4 5 6 7 8 9 1 chunk +103 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_command_service.cc View 1 2 3 4 5 6 7 8 9 1 chunk +231 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_command_service_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +38 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_command_service_factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +43 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_keybinding_apitest.cc View 1 2 3 4 5 6 7 8 1 chunk +14 lines, -2 lines 0 comments Download
M chrome/browser/prefs/browser_prefs.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_dependency_manager.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/ui/gtk/location_bar_view_gtk.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/ui/views/browser_actions_container.cc View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/extensions/extension_installed_bubble.cc View 1 2 3 4 5 6 7 8 4 chunks +11 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/extensions/extension_keybinding_registry_views.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/extensions/extension_keybinding_registry_views.cc View 1 2 3 4 5 6 7 8 3 chunks +16 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/location_bar/page_action_image_view.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -1 line 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension.h View 1 2 3 4 5 6 7 8 9 3 chunks +13 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension.cc View 1 2 3 4 5 6 7 8 2 chunks +16 lines, -13 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/keybinding/conflicting/background.js View 1 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/keybinding/conflicting/manifest.json View 1 2 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Finnur
8 years, 7 months ago (2012-04-25 16:23:48 UTC) #1
Aaron Boodman
http://codereview.chromium.org/10201016/diff/10004/chrome/browser/extensions/extension_keybinding_registry.cc File chrome/browser/extensions/extension_keybinding_registry.cc (right): http://codereview.chromium.org/10201016/diff/10004/chrome/browser/extensions/extension_keybinding_registry.cc#newcode56 chrome/browser/extensions/extension_keybinding_registry.cc:56: PrefService::UNSYNCABLE_PREF); This seems like something we'd want to sync. ...
8 years, 7 months ago (2012-04-25 19:14:38 UTC) #2
Finnur
PTAL http://codereview.chromium.org/10201016/diff/10004/chrome/browser/extensions/extension_keybinding_registry.cc File chrome/browser/extensions/extension_keybinding_registry.cc (right): http://codereview.chromium.org/10201016/diff/10004/chrome/browser/extensions/extension_keybinding_registry.cc#newcode56 chrome/browser/extensions/extension_keybinding_registry.cc:56: PrefService::UNSYNCABLE_PREF); Yes. I've now changed this to SYNCABLE_PREF. ...
8 years, 7 months ago (2012-04-26 13:12:35 UTC) #3
Finnur
Also, need OWNERS LG from: erg: chrome/browser/ui/gtk sky: chrome/browser/ui/views
8 years, 7 months ago (2012-04-26 13:29:39 UTC) #4
sky
LGTM
8 years, 7 months ago (2012-04-26 16:07:23 UTC) #5
Aaron Boodman
http://codereview.chromium.org/10201016/diff/10004/chrome/browser/extensions/extension_service.cc File chrome/browser/extensions/extension_service.cc (right): http://codereview.chromium.org/10201016/diff/10004/chrome/browser/extensions/extension_service.cc#newcode813 chrome/browser/extensions/extension_service.cc:813: ExtensionKeybindingRegistry::RemoveKeybindingPref(profile_->GetPrefs(), On 2012/04/26 13:12:35, Finnur wrote: > I thought ...
8 years, 7 months ago (2012-04-26 19:29:30 UTC) #6
Finnur
Is there a similar object in the codebase that I can model it after, to ...
8 years, 7 months ago (2012-04-26 21:06:06 UTC) #7
Aaron Boodman
On Thu, Apr 26, 2012 at 2:06 PM, <finnur@chromium.org> wrote: > Is there a similar ...
8 years, 7 months ago (2012-04-26 22:46:39 UTC) #8
Yoyo Zhou
On Thu, Apr 26, 2012 at 3:46 PM, Aaron Boodman <aa@chromium.org> wrote: > On Thu, ...
8 years, 7 months ago (2012-04-27 03:33:23 UTC) #9
Finnur
OK, I've done what I think you wanted. Please review the factory code carefully. It ...
8 years, 7 months ago (2012-04-27 16:23:24 UTC) #10
Yoyo Zhou
On 2012/04/27 16:23:24, Finnur wrote: > OK, I've done what I think you wanted. Please ...
8 years, 7 months ago (2012-04-27 16:54:55 UTC) #11
Finnur
PTAL. https://chromiumcodereview.appspot.com/10201016/diff/42002/chrome/browser/extensions/extension_command_service.cc File chrome/browser/extensions/extension_command_service.cc (right): https://chromiumcodereview.appspot.com/10201016/diff/42002/chrome/browser/extensions/extension_command_service.cc#newcode199 chrome/browser/extensions/extension_command_service.cc:199: RemoveKeybindingPrefs(*content::Details<std::string>(details).ptr()); I made an error here earlier and ...
8 years, 7 months ago (2012-04-30 09:28:37 UTC) #12
Finnur
> PTAL. To elaborate: aa & yoyo: PTAL. sky: Thanks for your LG. erg: Can ...
8 years, 7 months ago (2012-04-30 09:30:53 UTC) #13
Aaron Boodman
https://chromiumcodereview.appspot.com/10201016/diff/42002/chrome/browser/extensions/extension_command_service.h File chrome/browser/extensions/extension_command_service.h (right): https://chromiumcodereview.appspot.com/10201016/diff/42002/chrome/browser/extensions/extension_command_service.h#newcode1 chrome/browser/extensions/extension_command_service.h:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
8 years, 7 months ago (2012-04-30 17:48:12 UTC) #14
Yoyo Zhou
http://codereview.chromium.org/10201016/diff/42002/chrome/browser/extensions/extension_command_service.cc File chrome/browser/extensions/extension_command_service.cc (right): http://codereview.chromium.org/10201016/diff/42002/chrome/browser/extensions/extension_command_service.cc#newcode39 chrome/browser/extensions/extension_command_service.cc:39: content::Source<Profile>(profile->GetOriginalProfile())); Since it's redirected in incognito, the profile you ...
8 years, 7 months ago (2012-05-01 01:51:30 UTC) #15
Yoyo Zhou
http://codereview.chromium.org/10201016/diff/42002/chrome/browser/profiles/profile_dependency_manager.cc File chrome/browser/profiles/profile_dependency_manager.cc (right): http://codereview.chromium.org/10201016/diff/42002/chrome/browser/profiles/profile_dependency_manager.cc#newcode179 chrome/browser/profiles/profile_dependency_manager.cc:179: ExtensionCommandServiceFactory::GetInstance(); Comment for erg: I realize that I never ...
8 years, 7 months ago (2012-05-01 01:52:48 UTC) #16
Elliot Glaysher
gtk lgtm http://codereview.chromium.org/10201016/diff/42002/chrome/browser/profiles/profile_dependency_manager.cc File chrome/browser/profiles/profile_dependency_manager.cc (right): http://codereview.chromium.org/10201016/diff/42002/chrome/browser/profiles/profile_dependency_manager.cc#newcode179 chrome/browser/profiles/profile_dependency_manager.cc:179: ExtensionCommandServiceFactory::GetInstance(); On 2012/05/01 01:52:49, Yoyo Zhou wrote: ...
8 years, 7 months ago (2012-05-01 17:42:50 UTC) #17
Finnur
erg: Thanks for the review. aa & yoyo: PTAL. I believe I've addressed all comments ...
8 years, 7 months ago (2012-05-02 13:50:45 UTC) #18
Yoyo Zhou
LGTM http://codereview.chromium.org/10201016/diff/42002/chrome/browser/extensions/extension_command_service.cc File chrome/browser/extensions/extension_command_service.cc (right): http://codereview.chromium.org/10201016/diff/42002/chrome/browser/extensions/extension_command_service.cc#newcode51 chrome/browser/extensions/extension_command_service.cc:51: profile_->GetExtensionService()->GetExtensionById(extension_id, false); On 2012/05/02 13:50:45, Finnur wrote: > ...
8 years, 7 months ago (2012-05-02 19:12:49 UTC) #19
Aaron Boodman
LGTM (2) On Wed, May 2, 2012 at 12:12 PM, <yoz@chromium.org> wrote: > LGTM > ...
8 years, 7 months ago (2012-05-02 20:06:48 UTC) #20
Finnur
8 years, 7 months ago (2012-05-03 10:22:18 UTC) #21
http://codereview.chromium.org/10201016/diff/42002/chrome/browser/extensions/...
File chrome/browser/extensions/extension_command_service.cc (right):

http://codereview.chromium.org/10201016/diff/42002/chrome/browser/extensions/...
chrome/browser/extensions/extension_command_service.cc:51:
profile_->GetExtensionService()->GetExtensionById(extension_id, false);
I see.

Done!

Powered by Google App Engine
This is Rietveld 408576698