| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/site_instance.h" | 10 #include "chrome/browser/renderer_host/site_instance.h" |
| 11 #include "gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 12 #include "gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 13 | 13 |
| 14 Balloon::Balloon(const Notification& notification, Profile* profile, | 14 Balloon::Balloon(const Notification& notification, Profile* profile, |
| 15 BalloonCollection* collection) | 15 BalloonCollection* collection) |
| 16 : profile_(profile), | 16 : profile_(profile), |
| 17 notification_(new Notification(notification)), | 17 notification_(new Notification(notification)), |
| 18 collection_(collection) { | 18 collection_(collection) { |
| 19 } | 19 } |
| 20 | 20 |
| 21 Balloon::~Balloon() { | 21 Balloon::~Balloon() { |
| 22 } | 22 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 notification_->Close(by_user); | 60 notification_->Close(by_user); |
| 61 collection_->OnBalloonClosed(this); | 61 collection_->OnBalloonClosed(this); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void Balloon::CloseByScript() { | 64 void Balloon::CloseByScript() { |
| 65 // A user-initiated close begins with the view and then closes this object; | 65 // A user-initiated close begins with the view and then closes this object; |
| 66 // we simulate that with a script-initiated close but pass |by_user|=false. | 66 // we simulate that with a script-initiated close but pass |by_user|=false. |
| 67 DCHECK(balloon_view_.get()); | 67 DCHECK(balloon_view_.get()); |
| 68 balloon_view_->Close(false); | 68 balloon_view_->Close(false); |
| 69 } | 69 } |
| OLD | NEW |