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

Issue 789763004: Fix disappearing page actions bug. (Closed)

Created:
6 years ago by erikchen
Modified:
5 years, 11 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix disappearing page actions bug. The logic in LocationBarViewMac implicitly relied on the assumption that there is a 1:1 correspondence between |page_actions_| and |page_action_decorations_|. The implementation of DeletePageActionDecorations() cleared one vector but not the other, breaking this implicit assumption and causing the bug. This CL removes |page_actions_|, as the information is already contained within |page_action_decorations_|, which fixes the bug. The same was true for LocationBarView, modulo some minor renaming of members and methods. There was a second bug in LocationBarView, where InvalidatePageActions() deleted the page actions instead of refreshing them. The documentation for InvalidatePageActions() and UpdatePageActions() implied that the two methods were called at different times, and should have different effects. Looking at the call sites, UpdatePageActions() was being called in places where the documentation implied InvalidatePageActions() should be called. This CL deletes InvalidatePageActions(). BUG=173055 TBR=jcivelli@chromium.org Committed: https://crrev.com/545918a1b072eed5e15f28c772c682f9167b6677 Cr-Commit-Position: refs/heads/master@{#309797}

Patch Set 1 : Minor rename. #

Total comments: 11

Patch Set 2 : Significant clean up. #

Total comments: 4

Patch Set 3 : Comments from pkasting. #

Total comments: 6

Patch Set 4 : Comments from pkasting. #

Patch Set 5 : Comments from wittman. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -42 lines) Patch
M chrome/browser/ui/browser.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h View 1 2 3 4 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm View 1 2 3 4 4 chunks +18 lines, -10 lines 0 comments Download
M chrome/browser/ui/location_bar/location_bar.h View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.h View 1 2 3 4 4 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 2 3 4 3 chunks +24 lines, -17 lines 0 comments Download
M chrome/test/base/test_browser_window.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 42 (15 generated)
erikchen
Merry christmas!
6 years ago (2014-12-20 02:56:00 UTC) #4
danduong
Thanks, Erik!
6 years ago (2014-12-20 03:01:03 UTC) #6
danduong
https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/views/location_bar/location_bar_view.cc File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/views/location_bar/location_bar_view.cc#newcode1089 chrome/browser/ui/views/location_bar/location_bar_view.cc:1089: page_action_views.clear(); This should be page_action_views_. Also we need to ...
6 years ago (2014-12-20 03:09:22 UTC) #7
Mike Wittman
Thanks! Page actions are owned by the extension system, so we should just clear them ...
6 years ago (2014-12-20 03:11:23 UTC) #9
danduong
I might have added pkastings prematurely. Erik will clean it up in the beginning of ...
6 years ago (2014-12-20 03:17:02 UTC) #11
danduong
https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm File chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm (right): https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm#newcode686 chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm:686: page_action_decorations_.clear(); do you have to call [[field_ cell] clearDecorations] ...
6 years ago (2014-12-20 03:21:24 UTC) #12
danduong
https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h File chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h (left): https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h#oldcode249 chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h:249: std::vector<ExtensionAction*> page_actions_; Same comment as the views implementation. We ...
6 years ago (2014-12-20 03:22:14 UTC) #13
danduong
https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/views/location_bar/location_bar_view.cc File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/views/location_bar/location_bar_view.cc#newcode1297 chrome/browser/ui/views/location_bar/location_bar_view.cc:1297: DeletePageActionsAndViews(); Hah! I think the bug is actually here. ...
6 years ago (2014-12-20 04:28:41 UTC) #14
danduong
https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/views/location_bar/location_bar_view.cc File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): https://codereview.chromium.org/789763004/diff/40001/chrome/browser/ui/views/location_bar/location_bar_view.cc#newcode1297 chrome/browser/ui/views/location_bar/location_bar_view.cc:1297: DeletePageActionsAndViews(); On 2014/12/20 04:28:40, danduong wrote: > Hah! I ...
6 years ago (2014-12-20 04:59:05 UTC) #15
erikchen
danduong: PTAL I rewrote the CL to incorporate your feedback. Check out the new CL ...
6 years ago (2014-12-22 20:39:44 UTC) #18
danduong
lgtm
6 years ago (2014-12-22 22:03:25 UTC) #19
erikchen
pkasting: Please review.
6 years ago (2014-12-22 22:04:31 UTC) #21
Peter Kasting
I'm not qualified to review the Mac stuff, but the views stuff LGTM. I confess ...
6 years ago (2014-12-23 00:20:05 UTC) #22
erikchen
shess: Looking for an OWNER review of chrome/browser/ui/cocoa/location_bar/* https://codereview.chromium.org/789763004/diff/100001/chrome/browser/ui/views/location_bar/location_bar_view.cc File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): https://codereview.chromium.org/789763004/diff/100001/chrome/browser/ui/views/location_bar/location_bar_view.cc#newcode1309 chrome/browser/ui/views/location_bar/location_bar_view.cc:1309: RefreshPageActionViews(); ...
6 years ago (2014-12-23 00:55:04 UTC) #25
erikchen
jcivelli: Looking for an OWNER review of chrome/test/base/test_browser_window.h.
6 years ago (2014-12-23 00:56:37 UTC) #27
Peter Kasting
https://codereview.chromium.org/789763004/diff/140001/chrome/browser/ui/location_bar/location_bar.h File chrome/browser/ui/location_bar/location_bar.h (right): https://codereview.chromium.org/789763004/diff/140001/chrome/browser/ui/location_bar/location_bar.h#newcode58 chrome/browser/ui/location_bar/location_bar.h:58: // Updates the state of the page actions. So ...
6 years ago (2014-12-23 01:00:42 UTC) #28
erikchen
https://codereview.chromium.org/789763004/diff/140001/chrome/browser/ui/location_bar/location_bar.h File chrome/browser/ui/location_bar/location_bar.h (right): https://codereview.chromium.org/789763004/diff/140001/chrome/browser/ui/location_bar/location_bar.h#newcode58 chrome/browser/ui/location_bar/location_bar.h:58: // Updates the state of the page actions. On ...
6 years ago (2014-12-23 01:14:44 UTC) #29
Mike Wittman
lgtm https://codereview.chromium.org/789763004/diff/140001/chrome/browser/ui/views/location_bar/location_bar_view.cc File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): https://codereview.chromium.org/789763004/diff/140001/chrome/browser/ui/views/location_bar/location_bar_view.cc#newcode1118 chrome/browser/ui/views/location_bar/location_bar_view.cc:1118: if (!page_action_views_.empty() && web_contents) { nit: this check ...
6 years ago (2014-12-23 01:21:56 UTC) #30
erikchen
https://codereview.chromium.org/789763004/diff/140001/chrome/browser/ui/views/location_bar/location_bar_view.cc File chrome/browser/ui/views/location_bar/location_bar_view.cc (right): https://codereview.chromium.org/789763004/diff/140001/chrome/browser/ui/views/location_bar/location_bar_view.cc#newcode1118 chrome/browser/ui/views/location_bar/location_bar_view.cc:1118: if (!page_action_views_.empty() && web_contents) { On 2014/12/23 01:21:55, Mike ...
6 years ago (2014-12-23 01:29:36 UTC) #32
erikchen
rsesek: Looking for an OWNER review of chrome/browser/ui/cocoa/*.
5 years, 11 months ago (2014-12-29 18:34:10 UTC) #34
Robert Sesek
lgtm
5 years, 11 months ago (2014-12-30 15:39:20 UTC) #35
erikchen
jcivelli: ping?
5 years, 11 months ago (2014-12-30 19:35:49 UTC) #36
erikchen
TBR'ing jcivelli since the change to chrome/test/base/test_browser_window.h is just a 1-liner.
5 years, 11 months ago (2014-12-30 22:00:50 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/789763004/190001
5 years, 11 months ago (2014-12-30 22:01:20 UTC) #39
commit-bot: I haz the power
Committed patchset #5 (id:190001)
5 years, 11 months ago (2014-12-31 02:34:33 UTC) #40
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/545918a1b072eed5e15f28c772c682f9167b6677 Cr-Commit-Position: refs/heads/master@{#309797}
5 years, 11 months ago (2014-12-31 02:35:30 UTC) #41
Scott Hess - ex-Googler
5 years, 11 months ago (2015-01-05 20:12:28 UTC) #42
Message was sent while issue was closed.
On 2014/12/23 00:55:04, erikchen wrote:
> shess: Looking for an OWNER review of chrome/browser/ui/cocoa/location_bar/*

Oops, sorry for missing this - in any case, ++LGTM++, I encourage you to dive
into this code to clarify and add lightness, now that we're getting closer to
one implementation.

Powered by Google App Engine
This is Rietveld 408576698