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

Issue 161293002: mac: Allows extensions to hide the bookmark page menu item. (Closed)

Created:
6 years, 10 months ago by erikchen
Modified:
6 years, 9 months ago
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

mac: Allows extensions to hide the bookmark page menu item. The hidden property of the NSMenuItem is dynamically updated in validateUserInterfaceItem:. That's not the intended purpose of the method, but that's already how menu_controller/menu_model update the visibility of menu items. validateUserInterfaceItem: is also called when a user attempts to invoke the menu item with an accelerator, so this method will also allow/prevent users from using an accelerator for the menu item. This CL also hooks up the Cocoa logic for showing browser/page action popups when a user selects the "bookmark this page" menu item. BUG=342484 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=253888

Patch Set 1 : Rebase #

Total comments: 5

Patch Set 2 : Respond to rsesek comments. #

Patch Set 3 : Rebase and hook up browser/page actions. #

Patch Set 4 : Minor cleanup. #

Total comments: 15

Patch Set 5 : This patchset only contains code to stop using notifications. #

Patch Set 6 : Respond to remaining rsesek/wittman comments. #

Total comments: 5

Patch Set 7 : Remove unused headers. #

Total comments: 4

Patch Set 8 : Respond to sky's comments. #

Patch Set 9 : Make sure changes only apply to OSX. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -42 lines) Patch
M chrome/browser/ui/bookmarks/bookmark_utils.h View 1 2 3 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_utils.cc View 1 2 3 4 5 6 7 2 chunks +35 lines, -8 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.mm View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 1 2 3 4 3 chunks +20 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/browser_actions_controller.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm View 1 2 3 4 2 chunks +16 lines, -11 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/page_action_decoration.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm View 1 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/toolbar/toolbar_controller.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/toolbar/wrench_menu_model.cc View 1 2 3 4 5 6 7 8 2 chunks +25 lines, -17 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
erikchen
This change implements (step 3), as suggested by rsesek in crbug.com/342484 https://codereview.chromium.org/161293002/diff/30001/chrome/browser/ui/bookmarks/bookmark_utils.h File chrome/browser/ui/bookmarks/bookmark_utils.h (right): ...
6 years, 10 months ago (2014-02-12 21:29:32 UTC) #1
erikchen
6 years, 10 months ago (2014-02-18 16:36:12 UTC) #2
Nico
So the idea is that when an extension handles bookmarking, the menu won't blink (and ...
6 years, 10 months ago (2014-02-20 03:40:41 UTC) #3
erikchen
I don't know what you mean by "blink". Here is a link to the bug ...
6 years, 10 months ago (2014-02-20 16:23:03 UTC) #4
Nico
If you hit cmd-d, the Bookmarks menu entry lights up for a short time in ...
6 years, 10 months ago (2014-02-20 16:32:21 UTC) #5
erikchen
The build that I've uploaded has no effect on "blinking". When the menu item is ...
6 years, 10 months ago (2014-02-20 17:21:31 UTC) #6
Robert Sesek
I think the menubar highlighting/"blinking" is correct in this case, right? The idea is that ...
6 years, 10 months ago (2014-02-24 14:06:05 UTC) #7
erikchen
rsesek: Patch set 2 responds to your comments (it includes a small rebase, oops!). Because ...
6 years, 10 months ago (2014-02-26 01:08:18 UTC) #8
Robert Sesek
https://codereview.chromium.org/161293002/diff/220007/chrome/browser/ui/bookmarks/bookmark_utils.cc File chrome/browser/ui/bookmarks/bookmark_utils.cc (right): https://codereview.chromium.org/161293002/diff/220007/chrome/browser/ui/bookmarks/bookmark_utils.cc#newcode307 chrome/browser/ui/bookmarks/bookmark_utils.cc:307: ->extension_service() It's more common to put the pointer indirection ...
6 years, 10 months ago (2014-02-26 18:05:13 UTC) #9
Mike Wittman
https://codereview.chromium.org/161293002/diff/220007/chrome/browser/ui/bookmarks/bookmark_utils.cc File chrome/browser/ui/bookmarks/bookmark_utils.cc (right): https://codereview.chromium.org/161293002/diff/220007/chrome/browser/ui/bookmarks/bookmark_utils.cc#newcode309 chrome/browser/ui/bookmarks/bookmark_utils.cc:309: for (extensions::ExtensionSet::const_iterator i = extension_set->begin(); On 2014/02/26 18:05:13, rsesek ...
6 years, 10 months ago (2014-02-26 18:29:05 UTC) #10
erikchen
rsesek: PTAL https://codereview.chromium.org/161293002/diff/220007/chrome/browser/ui/bookmarks/bookmark_utils.cc File chrome/browser/ui/bookmarks/bookmark_utils.cc (right): https://codereview.chromium.org/161293002/diff/220007/chrome/browser/ui/bookmarks/bookmark_utils.cc#newcode307 chrome/browser/ui/bookmarks/bookmark_utils.cc:307: ->extension_service() Done. I was using the output ...
6 years, 10 months ago (2014-02-26 19:58:23 UTC) #11
Mike Wittman
GetBookmarkShortcutDisposition lgtm https://codereview.chromium.org/161293002/diff/260001/chrome/browser/ui/cocoa/browser_window_cocoa.h File chrome/browser/ui/cocoa/browser_window_cocoa.h (right): https://codereview.chromium.org/161293002/diff/260001/chrome/browser/ui/cocoa/browser_window_cocoa.h#newcode11 chrome/browser/ui/cocoa/browser_window_cocoa.h:11: #include "chrome/browser/extensions/api/commands/command_service.h" Remove this header? https://codereview.chromium.org/161293002/diff/260001/chrome/browser/ui/cocoa/browser_window_cocoa.mm File ...
6 years, 10 months ago (2014-02-26 20:16:02 UTC) #12
Robert Sesek
LGTM https://codereview.chromium.org/161293002/diff/220007/chrome/browser/ui/bookmarks/bookmark_utils.cc File chrome/browser/ui/bookmarks/bookmark_utils.cc (right): https://codereview.chromium.org/161293002/diff/220007/chrome/browser/ui/bookmarks/bookmark_utils.cc#newcode307 chrome/browser/ui/bookmarks/bookmark_utils.cc:307: ->extension_service() On 2014/02/26 19:58:23, erikchen1 wrote: > Done. ...
6 years, 10 months ago (2014-02-26 20:30:00 UTC) #13
erikchen
https://codereview.chromium.org/161293002/diff/260001/chrome/browser/ui/cocoa/browser_window_cocoa.h File chrome/browser/ui/cocoa/browser_window_cocoa.h (right): https://codereview.chromium.org/161293002/diff/260001/chrome/browser/ui/cocoa/browser_window_cocoa.h#newcode11 chrome/browser/ui/cocoa/browser_window_cocoa.h:11: #include "chrome/browser/extensions/api/commands/command_service.h" On 2014/02/26 20:16:03, Mike Wittman wrote: > ...
6 years, 10 months ago (2014-02-26 20:53:51 UTC) #14
erikchen
sky: I'm looking for an OWNER to review chrome/browser/ui/bookmarks/bookmark_utils.h chrome/browser/ui/bookmarks/bookmark_utils.cc chrome/browser/ui/toolbar/wrench_menu_model.cc
6 years, 10 months ago (2014-02-26 21:10:51 UTC) #15
sky
Do you need to disable the bookmark command too? https://codereview.chromium.org/161293002/diff/280001/chrome/browser/ui/bookmarks/bookmark_utils.cc File chrome/browser/ui/bookmarks/bookmark_utils.cc (right): https://codereview.chromium.org/161293002/diff/280001/chrome/browser/ui/bookmarks/bookmark_utils.cc#newcode305 chrome/browser/ui/bookmarks/bookmark_utils.cc:305: ...
6 years, 10 months ago (2014-02-26 21:46:31 UTC) #16
erikchen
sky: thank you for the fast turn around! In response to the question: "Do you ...
6 years, 10 months ago (2014-02-26 22:31:19 UTC) #17
sky
Does the disabling work on windows? I don't believe it's keyed off the menu items.
6 years, 10 months ago (2014-02-27 00:25:40 UTC) #18
erikchen
It's not intended to work on Windows. This is the Cocoa implementation of the desired ...
6 years, 10 months ago (2014-02-27 00:32:45 UTC) #19
erikchen
sky: I've updated the code in chrome/browser/ui/toolbar/wrench_menu_model.cc to only hide the bookmark menu item on ...
6 years, 10 months ago (2014-02-27 00:43:14 UTC) #20
sky
Ok, LGTM
6 years, 10 months ago (2014-02-27 01:24:30 UTC) #21
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 10 months ago (2014-02-27 01:32:13 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/161293002/280002
6 years, 10 months ago (2014-02-27 01:35:55 UTC) #23
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-02-27 07:18:42 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel
6 years, 9 months ago (2014-02-27 07:18:43 UTC) #25
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 9 months ago (2014-02-27 16:49:27 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/161293002/280002
6 years, 9 months ago (2014-02-27 16:49:56 UTC) #27
commit-bot: I haz the power
6 years, 9 months ago (2014-02-27 19:01:51 UTC) #28
Message was sent while issue was closed.
Change committed as 253888

Powered by Google App Engine
This is Rietveld 408576698