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

Unified Diff: chrome/browser/notifications/balloon_collection_impl.cc

Issue 9621020: Fix 117074: Panels [WIN]: Crash data shows a stack trace consistently involving PanelManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 8 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/notifications/balloon_collection_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/balloon_collection_impl.cc
diff --git a/chrome/browser/notifications/balloon_collection_impl.cc b/chrome/browser/notifications/balloon_collection_impl.cc
index ec95f8ec42f8584efb9ac77b5e939baebd07e4b0..cfeeac680e4cbeaf0e995a35f0e950a15d654ec4 100644
--- a/chrome/browser/notifications/balloon_collection_impl.cc
+++ b/chrome/browser/notifications/balloon_collection_impl.cc
@@ -186,6 +186,7 @@ void BalloonCollectionImpl::Observe(
// Fall through.
case chrome::NOTIFICATION_PANEL_ADDED:
case chrome::NOTIFICATION_PANEL_CLOSED:
+ layout_.enable_computing_panel_offset();
if (layout_.ComputeOffsetToMoveAbovePanels(bounds))
PositionBalloons(true);
break;
@@ -275,6 +276,7 @@ void BalloonCollectionImpl::HandleMouseMoveEvent() {
BalloonCollectionImpl::Layout::Layout()
: placement_(INVALID),
+ need_to_compute_panel_offset_(false),
offset_to_move_above_panels_(0) {
RefreshSystemMetrics();
}
@@ -406,6 +408,13 @@ gfx::Size BalloonCollectionImpl::Layout::ConstrainToSizeLimits(
bool BalloonCollectionImpl::Layout::ComputeOffsetToMoveAbovePanels(
const gfx::Rect& panel_bounds) {
+ // If the offset is not enabled due to that we have not received a
+ // notification about panel, don't proceed because we don't want to call
+ // PanelManager::GetInstance() to create an instance when panel is not
+ // present.
+ if (!need_to_compute_panel_offset_)
+ return false;
+
const DockedPanelStrip::Panels& panels =
PanelManager::GetInstance()->docked_strip()->panels();
int offset_to_move_above_panels = 0;
« no previous file with comments | « chrome/browser/notifications/balloon_collection_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698