Views: Don't unnecessarily invalidate layout when setting app menu button margin

Currently, we invalidate the app menu button's layout unconditionally when setting
its margin. Since invalidating layout walks up the view hierarchy, this essentially
keeps ToolbarView's layout dirty all the time.

This change exits early if the new margin is the same as the current margin.

Bug: 858944, 835983
Change-Id: If94d3c7d29cb1476fdb268a8ece35187d0b43f4f
Reviewed-on: https://chromium-review.googlesource.com/1144222
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#576873}(cherry picked from commit 02b33c1f9c7145169cfda0caf4b5eb0c50e471b5)
Reviewed-on: https://chromium-review.googlesource.com/1147181
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#20}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
1 file changed