| OLD | NEW |
| 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_collection_impl.h" | 5 #include "chrome/browser/notifications/balloon_collection_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // This is used only for testing. | 85 // This is used only for testing. |
| 86 if (!on_collection_changed_callback_.is_null()) | 86 if (!on_collection_changed_callback_.is_null()) |
| 87 on_collection_changed_callback_.Run(); | 87 on_collection_changed_callback_.Run(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void BalloonCollectionImpl::Add(const Notification& notification, | 90 void BalloonCollectionImpl::Add(const Notification& notification, |
| 91 Profile* profile) { | 91 Profile* profile) { |
| 92 AddImpl(notification, profile, false); | 92 AddImpl(notification, profile, false); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool BalloonCollectionImpl::DoesIdExist(const std::string& id) { | 95 const Notification* BalloonCollectionImpl::FindById( |
| 96 return base_.DoesIdExist(id); | 96 const std::string& id) const { |
| 97 return base_.FindById(id); |
| 97 } | 98 } |
| 98 | 99 |
| 99 bool BalloonCollectionImpl::RemoveById(const std::string& id) { | 100 bool BalloonCollectionImpl::RemoveById(const std::string& id) { |
| 100 return base_.CloseById(id); | 101 return base_.CloseById(id); |
| 101 } | 102 } |
| 102 | 103 |
| 103 bool BalloonCollectionImpl::RemoveBySourceOrigin(const GURL& origin) { | 104 bool BalloonCollectionImpl::RemoveBySourceOrigin(const GURL& origin) { |
| 104 return base_.CloseAllBySourceOrigin(origin); | 105 return base_.CloseAllBySourceOrigin(origin); |
| 105 } | 106 } |
| 106 | 107 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area(); | 479 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area(); |
| 479 #endif | 480 #endif |
| 480 if (work_area_ != new_work_area) { | 481 if (work_area_ != new_work_area) { |
| 481 work_area_.SetRect(new_work_area.x(), new_work_area.y(), | 482 work_area_.SetRect(new_work_area.x(), new_work_area.y(), |
| 482 new_work_area.width(), new_work_area.height()); | 483 new_work_area.width(), new_work_area.height()); |
| 483 changed = true; | 484 changed = true; |
| 484 } | 485 } |
| 485 | 486 |
| 486 return changed; | 487 return changed; |
| 487 } | 488 } |
| OLD | NEW |