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

Side by Side Diff: chrome/browser/notifications/balloon_collection.cc

Issue 2861035: Don't try to animate the balloon before it's been shown, it will cause a cras... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/notifications/balloon_collection_impl.h" 5 #include "chrome/browser/notifications/balloon_collection_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "chrome/browser/notifications/balloon.h" 9 #include "chrome/browser/notifications/balloon.h"
10 #include "chrome/browser/notifications/notification.h" 10 #include "chrome/browser/notifications/notification.h"
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 36
37 BalloonCollectionImpl::~BalloonCollectionImpl() { 37 BalloonCollectionImpl::~BalloonCollectionImpl() {
38 STLDeleteElements(&balloons_); 38 STLDeleteElements(&balloons_);
39 } 39 }
40 40
41 void BalloonCollectionImpl::Add(const Notification& notification, 41 void BalloonCollectionImpl::Add(const Notification& notification,
42 Profile* profile) { 42 Profile* profile) {
43 Balloon* new_balloon = MakeBalloon(notification, profile); 43 Balloon* new_balloon = MakeBalloon(notification, profile);
44 44
45 new_balloon->SetPosition(layout_.OffScreenLocation(), true); 45 new_balloon->SetPosition(layout_.OffScreenLocation(), false);
46 new_balloon->Show(); 46 new_balloon->Show();
47 balloons_.push_back(new_balloon); 47 balloons_.push_back(new_balloon);
48 PositionBalloons(false); 48 PositionBalloons(false);
49 49
50 // There may be no listener in a unit test. 50 // There may be no listener in a unit test.
51 if (space_change_listener_) 51 if (space_change_listener_)
52 space_change_listener_->OnBalloonSpaceChanged(); 52 space_change_listener_->OnBalloonSpaceChanged();
53 } 53 }
54 54
55 bool BalloonCollectionImpl::Remove(const Notification& notification) { 55 bool BalloonCollectionImpl::Remove(const Notification& notification) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 gfx::Rect new_work_area = info_provider->GetPrimaryMonitorWorkArea(); 222 gfx::Rect new_work_area = info_provider->GetPrimaryMonitorWorkArea();
223 #endif 223 #endif
224 if (!work_area_.Equals(new_work_area)) { 224 if (!work_area_.Equals(new_work_area)) {
225 work_area_.SetRect(new_work_area.x(), new_work_area.y(), 225 work_area_.SetRect(new_work_area.x(), new_work_area.y(),
226 new_work_area.width(), new_work_area.height()); 226 new_work_area.width(), new_work_area.height());
227 changed = true; 227 changed = true;
228 } 228 }
229 229
230 return changed; 230 return changed;
231 } 231 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698