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

Unified Diff: chrome/browser/ui/panels/docked_panel_collection.cc

Issue 12764018: Improve panel related tests to make them more reliable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/docked_panel_collection.h ('k') | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/docked_panel_collection.cc
diff --git a/chrome/browser/ui/panels/docked_panel_collection.cc b/chrome/browser/ui/panels/docked_panel_collection.cc
index da5c4cc121eb1020c721f1105d3d84f8b0b2b1a3..1c6ed18f93dfc1365135c62a319d1834db72e7ad 100644
--- a/chrome/browser/ui/panels/docked_panel_collection.cc
+++ b/chrome/browser/ui/panels/docked_panel_collection.cc
@@ -113,12 +113,8 @@ void DockedPanelCollection::AddPanel(Panel* panel,
panels_.insert(iter, panel);
}
- if (update_bounds) {
- if ((positioning_mask & DELAY_LAYOUT_REFRESH) != 0)
- ScheduleLayoutRefresh();
- else
- RefreshLayout();
- }
+ if (update_bounds)
+ RefreshLayout();
}
gfx::Point DockedPanelCollection::GetDefaultPositionForPanel(
@@ -766,20 +762,8 @@ void DockedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) {
panel->SetWindowCornerStyle(panel::TOP_ROUNDED);
}
-void DockedPanelCollection::ScheduleLayoutRefresh() {
- refresh_action_factory_.InvalidateWeakPtrs();
- MessageLoop::current()->PostDelayedTask(FROM_HERE,
- base::Bind(&DockedPanelCollection::RefreshLayout,
- refresh_action_factory_.GetWeakPtr()),
- base::TimeDelta::FromMilliseconds(PanelManager::AdjustTimeInterval(
- kRefreshLayoutAfterActivePanelChangeDelayMs)));
-}
-
void DockedPanelCollection::OnPanelActiveStateChanged(Panel* panel) {
- // Refresh layout, but wait till active states settle.
- // This lets us avoid refreshing too many times when one panel loses
- // focus and another gains it.
- ScheduleLayoutRefresh();
+ RefreshLayout();
}
bool DockedPanelCollection::HasPanel(Panel* panel) const {
« no previous file with comments | « chrome/browser/ui/panels/docked_panel_collection.h ('k') | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698