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

Issue 9547007: Fix handling of minimized panel count (Closed)

Created:
8 years, 9 months ago by Andrei
Modified:
8 years, 9 months ago
Reviewers:
jennb, jianli
CC:
chromium-reviews, Dmitry Lomov (no reviews), jennb, Dmitry Titov, jianli, dcheng, Andrei
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Fix handling of minimized panel count Increments and decrements of minimized panel count in the docking strip would not balance out in certain scenarios, e.g.: - if you add a panel that is already minimized (the count was incremented before the panel is added, sometimes causing a DCHECK to fire) - if you minimize a panel that is in "temporary layout" - if a panel's expansion state is changed when it is not in the docked strip (that is very hard to guard against, since a panel can jump into the overflow strip as a side effect of many operations) Changed the handling of minimized panel count to be more bullet-proof; added a test BUG=113682 TEST=PanelOverflowBrowserTest::AddMinimizedTillOverflow()

Patch Set 1 #

Total comments: 16
Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -28 lines) Patch
M chrome/browser/ui/panels/docked_panel_strip.h View 2 chunks +3 lines, -2 lines 1 comment Download
M chrome/browser/ui/panels/docked_panel_strip.cc View 6 chunks +20 lines, -21 lines 2 comments Download
M chrome/browser/ui/panels/panel.h View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/panels/panel.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/panels/panel_manager.cc View 1 chunk +7 lines, -1 line 4 comments Download
M chrome/browser/ui/panels/panel_overflow_browsertest.cc View 1 chunk +42 lines, -0 lines 9 comments Download

Messages

Total messages: 3 (0 generated)
Andrei
8 years, 9 months ago (2012-03-12 17:53:30 UTC) #1
jianli
http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/docked_panel_strip.cc File chrome/browser/ui/panels/docked_panel_strip.cc (right): http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/docked_panel_strip.cc#newcode436 chrome/browser/ui/panels/docked_panel_strip.cc:436: for (Panels::const_iterator i_panel = panels_.begin(); nit: normally we use ...
8 years, 9 months ago (2012-03-12 18:08:55 UTC) #2
jennb
8 years, 9 months ago (2012-03-12 18:26:27 UTC) #3
http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/docked...
File chrome/browser/ui/panels/docked_panel_strip.cc (right):

http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/docked...
chrome/browser/ui/panels/docked_panel_strip.cc:433: void
DockedPanelStrip::UpdateMinimizedPanelCount() {
Way more efficient to incr/decr a count than re-counting all panels. Is there a
way to ensure accuracy without losing efficiency?

http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/panel_...
File chrome/browser/ui/panels/panel_manager.cc (right):

http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/panel_...
chrome/browser/ui/panels/panel_manager.cc:177: // For panels outside of the
docked strip changing state is a no-op
Maybe reword to say "...but this method may be called while the panel is not in
the docked strip, so we need to check for that condition."

http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/panel_...
File chrome/browser/ui/panels/panel_overflow_browsertest.cc (right):

http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/panel_...
chrome/browser/ui/panels/panel_overflow_browsertest.cc:335: for (; num_panels <
10; ++num_panels) {
nit: suggest making the 10 a defined literal or a var.

http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/panel_...
chrome/browser/ui/panels/panel_overflow_browsertest.cc:342:
EXPECT_EQ(panel->expansion_state(), Panel::MINIMIZED);
reverse order. it's EXPECT_EQ(expected_value, actual_value).

http://codereview.chromium.org/9547007/diff/1/chrome/browser/ui/panels/panel_...
chrome/browser/ui/panels/panel_overflow_browsertest.cc:351:
WaitForLayoutModeChanged(last_panel, PanelStrip::IN_OVERFLOW);
When you do RemovePanel/AddPanel, the AddPanel will ensure the panel fits in the
dock. I'm surprised the last_panel still moves to overflow...

Powered by Google App Engine
This is Rietveld 408576698