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

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

Issue 11189002: Makes notifications animate from the bottom of the screen (as was (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.h" 5 #include "chrome/browser/notifications/balloon.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/notifications/balloon_collection.h" 8 #include "chrome/browser/notifications/balloon_collection.h"
9 #include "chrome/browser/notifications/notification.h" 9 #include "chrome/browser/notifications/notification.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
11 #include "ui/gfx/size.h" 11 #include "ui/gfx/size.h"
12 12
13 #if !defined(OS_WIN) && !defined(USE_AURA)
14 // static
15 int BalloonView::GetHorizontalMargin() {
16 // TODO: implement for linux (non-aura) and mac.
17 return 0;
18 }
19 #endif
20
13 Balloon::Balloon(const Notification& notification, Profile* profile, 21 Balloon::Balloon(const Notification& notification, Profile* profile,
14 BalloonCollection* collection) 22 BalloonCollection* collection)
15 : profile_(profile), 23 : profile_(profile),
16 notification_(new Notification(notification)), 24 notification_(new Notification(notification)),
17 collection_(collection) { 25 collection_(collection) {
18 } 26 }
19 27
20 Balloon::~Balloon() { 28 Balloon::~Balloon() {
21 } 29 }
22 30
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 notification_->Close(by_user); 67 notification_->Close(by_user);
60 collection_->OnBalloonClosed(this); 68 collection_->OnBalloonClosed(this);
61 } 69 }
62 70
63 void Balloon::CloseByScript() { 71 void Balloon::CloseByScript() {
64 // A user-initiated close begins with the view and then closes this object; 72 // A user-initiated close begins with the view and then closes this object;
65 // we simulate that with a script-initiated close but pass |by_user|=false. 73 // we simulate that with a script-initiated close but pass |by_user|=false.
66 DCHECK(balloon_view_.get()); 74 DCHECK(balloon_view_.get());
67 balloon_view_->Close(false); 75 balloon_view_->Close(false);
68 } 76 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/balloon.h ('k') | chrome/browser/notifications/balloon_collection_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698