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

Issue 2751573002: [Mac] Refactor bookmark bar controller (Closed)

Created:
3 years, 9 months ago by lgrey
Modified:
3 years, 7 months ago
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Yes, with RTL thrown in, since this is specifically designed to make it almost free. Two major things here: - The bar is no longer relaid-out directly in response to changes in view size, bookmark model etc. Instead, a new UI-direction-agnostic view model (BookmarkBarLayout) is created from the current state, and if it's different from before, it's applied to the view. - Removed a bunch of layout-related code that's no longer necessary BUG=648560 Review-Url: https://codereview.chromium.org/2751573002 Cr-Commit-Position: refs/heads/master@{#468364} Committed: https://chromium.googlesource.com/chromium/src/+/2644729cb7722a702a76cc2758d0ce372e1e6f92

Patch Set 1 #

Patch Set 2 : Clean up #

Patch Set 3 : More WIP #

Patch Set 4 : Restore unused button pool #

Total comments: 74

Patch Set 5 : Clean up #

Patch Set 6 : Comment expansion/clean up #

Patch Set 7 : Revert whitespace, fix syntax after symbol rename #

Total comments: 19

Patch Set 8 : Address CL comments #

Patch Set 9 : Whitespace/TODO #

Total comments: 6

Patch Set 10 : Factor layout tests to helper, address CL comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1226 lines, -1454 lines) Patch
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge_unittest.mm View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h View 1 2 3 4 5 5 chunks +68 lines, -17 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm View 1 2 3 4 5 6 7 8 9 51 chunks +664 lines, -921 lines 1 comment Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm View 1 2 3 4 5 6 7 8 9 22 chunks +462 lines, -467 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_cocoa.h View 1 2 3 4 2 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_cocoa.mm View 1 2 3 4 5 chunks +19 lines, -41 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 40 (26 generated)
Elly Fong-Jones
:) https://codereview.chromium.org/2751573002/diff/60001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm File chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm (left): https://codereview.chromium.org/2751573002/diff/60001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm#oldcode53 chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm:53: void BookmarkBarBridge::BookmarkModelBeingDeleted(BookmarkModel* model) { can this happen in ...
3 years, 9 months ago (2017-03-23 15:40:22 UTC) #2
Avi (use Gerrit)
I'm liking where you're going here. More style nits than anything else. Some thoughts: - ...
3 years, 9 months ago (2017-03-23 15:44:53 UTC) #4
lgrey
Ok, this is now ready for real review. I peeled a few pieces off last ...
3 years, 8 months ago (2017-04-10 19:14:33 UTC) #17
Avi (use Gerrit)
General encouragement to add more blank lines when appropriate. Maf might have been afraid of ...
3 years, 8 months ago (2017-04-10 20:25:55 UTC) #19
Elly Fong-Jones
https://codereview.chromium.org/2751573002/diff/120001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm File chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm (right): https://codereview.chromium.org/2751573002/diff/120001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm#newcode1779 chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm:1779: where < offset + NSWidth(buttonFrame)) { On 2017/04/10 20:25:54, ...
3 years, 7 months ago (2017-04-26 13:36:02 UTC) #20
lgrey
In addition to below comments, added some bug fixes for dragging in RTL and a ...
3 years, 7 months ago (2017-04-26 20:12:56 UTC) #25
Avi (use Gerrit)
Looks reasonable; good luck. LGTM https://codereview.chromium.org/2751573002/diff/160001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm File chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm (right): https://codereview.chromium.org/2751573002/diff/160001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm#newcode1575 chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm:1575: : array; [array objectEnumerator] ...
3 years, 7 months ago (2017-04-26 20:25:42 UTC) #26
lgrey
Updated with promised test updates https://codereview.chromium.org/2751573002/diff/160001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm File chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm (right): https://codereview.chromium.org/2751573002/diff/160001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm#newcode1575 chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm:1575: : array; On 2017/04/26 ...
3 years, 7 months ago (2017-04-27 17:35:33 UTC) #31
Avi (use Gerrit)
Still LGTM. https://codereview.chromium.org/2751573002/diff/180001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm File chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm (right): https://codereview.chromium.org/2751573002/diff/180001/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm#newcode1572 chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm:1572: id<NSFastEnumeration> buttonsToCheck = NSEnumerator*
3 years, 7 months ago (2017-04-27 18:00:29 UTC) #32
Elly Fong-Jones
lgtm nice work deduplicating the test logic :)
3 years, 7 months ago (2017-05-01 18:02:16 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2751573002/180001
3 years, 7 months ago (2017-05-01 18:09:19 UTC) #35
lgrey
Elly and Avi, thanks for the great review!
3 years, 7 months ago (2017-05-01 18:09:23 UTC) #36
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/chromium/src/+/2644729cb7722a702a76cc2758d0ce372e1e6f92
3 years, 7 months ago (2017-05-01 18:36:17 UTC) #39
sky
3 years, 7 months ago (2017-05-01 20:27:04 UTC) #40
Message was sent while issue was closed.
A revert of this CL (patchset #10 id:180001) has been created in
https://codereview.chromium.org/2853123002/ by sky@chromium.org.

The reason for reverting is: Reverting as likely caused msan failurs. See
https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.memory%2FMac_AS...
for example:

==77706==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000445b40
at pc 0x0001156ab4fe bp 0x7fff5c399fd0 sp 0x7fff5c399fc8
READ of size 8 at 0x603000445b40 thread T0
    #0 0x1156ab4fd in -[BookmarkBarController applyLayout:animated:] ??:0:0
    #1 0x1156a9db1 in -[BookmarkBarController rebuildLayoutWithAnimated:] ??:0:0
    #2 0x1156acf25 in -[BookmarkBarController nodeRemoved:parent:index:] ??:0:0
    #3 0x1127774c7 in
bookmarks::BookmarkModel::RemoveAndDeleteNode(bookmarks::BookmarkNode*) ??:0:0
    #4 0x112776d40 in bookmarks::BookmarkModel::Remove(bookmarks::BookmarkNode
const*) ??:0:0
    #5 0x10607a64c in (anonymous
namespace)::BookmarkFolderAppleScriptTest_DeleteBookmarkItems_Test::RunTestOnMainThread()
??:0:0
    #6 0x10d1f6ac3 in content::BrowserTestBase::ProxyRunTestOnMainThreadLoop()
??:0:0
    #7 0x10bb87dc3 in ChromeBrowserMainParts::PreMainMessageLoopRunImpl() ??:0:0
    #8 0x10bb851e6 in ChromeBrowserMainParts::PreMainMessageLoopRun() ??:0:0
    #9 0x1077b02dd in content::BrowserMainLoop::PreMainMessageLoopRun() ??:0:0
    #10 0x1084ba8a3 in content::StartupTaskRunner::RunAllTasksNow() ??:0:0
    #11 0x1077abc3a in content::BrowserMainLoop::CreateStartupTasks() ??:0:0
    #12 0x1077b94ec in
content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&)
??:0:0
    #13 0x1077a40b5 in content::BrowserMain(content::MainFunctionParams const&)
??:0:0
    #14 0x10b6a9604 in
content::RunNamedProcessTypeMain(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&,
content::MainFunctionParams const&, content::ContentMainDelegate*) ??:0:0
    #15 0x10b6ab3c7 in content::ContentMainRunnerImpl::Run() ??:0:0
    #16 0x111afc88b in service_manager::Main(service_manager::MainParams const&)
??:0:0
    #17 0x10b6a8ff4 in content::ContentMain(content::ContentMainParams const&)
??:0:0
    #18 0x10d1f5c4f in content::BrowserTestBase::SetUp() ??:0:0
    #19 0x10ba09201 in InProcessBrowserTest::SetUp() ??:0:0
    #20 0x10ed76b2f in testing::Test::Run() ??:0:0
    #21 0x10ed78b43 in testing::TestInfo::Run() ??:0:0
    #22 0x10ed79e86 in testing::TestCase::Run() ??:0:0
    #23 0x10ed8cfb6 in testing::internal::UnitTestImpl::RunAllTests() ??:0:0
    #24 0x10ed8c588 in testing::UnitTest::Run() ??:0:0
    #25 0x10ba51d3e in base::TestSuite::Run() ??:0:0
    #26 0x10b6fc3ac in ChromeTestSuiteRunner::RunTestSuite(int, char**) ??:0:0
    #27 0x10d2c7991 in content::LaunchTests(content::TestLauncherDelegate*, int,
int, char**) ??:0:0
    #28 0x10b6fc203 in main ??:0:0
    #29 0x7fff8a0125fc in start ??:0:0
.

Powered by Google App Engine
This is Rietveld 408576698