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/notifications/balloon.h" | 10 #include "chrome/browser/notifications/balloon.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 | 94 |
95 bool BalloonCollectionImpl::RemoveById(const std::string& id) { | 95 bool BalloonCollectionImpl::RemoveById(const std::string& id) { |
96 return base_.CloseById(id); | 96 return base_.CloseById(id); |
97 } | 97 } |
98 | 98 |
99 bool BalloonCollectionImpl::RemoveBySourceOrigin(const GURL& origin) { | 99 bool BalloonCollectionImpl::RemoveBySourceOrigin(const GURL& origin) { |
100 return base_.CloseAllBySourceOrigin(origin); | 100 return base_.CloseAllBySourceOrigin(origin); |
101 } | 101 } |
102 | 102 |
| 103 bool BalloonCollectionImpl::RemoveByProfile(Profile* profile) { |
| 104 return base_.CloseAllByProfile(profile); |
| 105 } |
| 106 |
103 void BalloonCollectionImpl::RemoveAll() { | 107 void BalloonCollectionImpl::RemoveAll() { |
104 base_.CloseAll(); | 108 base_.CloseAll(); |
105 } | 109 } |
106 | 110 |
107 bool BalloonCollectionImpl::HasSpace() const { | 111 bool BalloonCollectionImpl::HasSpace() const { |
108 int count = base_.count(); | 112 int count = base_.count(); |
109 if (count < kMinAllowedBalloonCount) | 113 if (count < kMinAllowedBalloonCount) |
110 return true; | 114 return true; |
111 | 115 |
112 int max_balloon_size = 0; | 116 int max_balloon_size = 0; |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area(); | 474 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area(); |
471 #endif | 475 #endif |
472 if (work_area_ != new_work_area) { | 476 if (work_area_ != new_work_area) { |
473 work_area_.SetRect(new_work_area.x(), new_work_area.y(), | 477 work_area_.SetRect(new_work_area.x(), new_work_area.y(), |
474 new_work_area.width(), new_work_area.height()); | 478 new_work_area.width(), new_work_area.height()); |
475 changed = true; | 479 changed = true; |
476 } | 480 } |
477 | 481 |
478 return changed; | 482 return changed; |
479 } | 483 } |
OLD | NEW |