OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/notifications/system_notification.h" | 5 #include "chrome/browser/chromeos/notifications/system_notification.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chromeos/notifications/system_notification_factory.h" | 9 #include "chrome/browser/chromeos/notifications/system_notification_factory.h" |
10 #include "chrome/browser/dom_ui/web_ui_util.h" | |
11 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
12 #include "chrome/browser/notifications/notification_ui_manager.h" | 11 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 12 #include "chrome/browser/webui/web_ui_util.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 | 15 |
16 void SystemNotification::Init(int icon_resource_id) { | 16 void SystemNotification::Init(int icon_resource_id) { |
17 collection_ = static_cast<BalloonCollectionImpl*>( | 17 collection_ = static_cast<BalloonCollectionImpl*>( |
18 g_browser_process->notification_ui_manager()->balloon_collection()); | 18 g_browser_process->notification_ui_manager()->balloon_collection()); |
19 std::string url = web_ui_util::GetImageDataUrlFromResource(icon_resource_id); | 19 std::string url = web_ui_util::GetImageDataUrlFromResource(icon_resource_id); |
20 DCHECK(!url.empty()); | 20 DCHECK(!url.empty()); |
21 GURL tmp_gurl(url); | 21 GURL tmp_gurl(url); |
22 icon_.Swap(&tmp_gurl); | 22 icon_.Swap(&tmp_gurl); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 void SystemNotification::Hide() { | 84 void SystemNotification::Hide() { |
85 if (visible_) { | 85 if (visible_) { |
86 collection_->RemoveById(delegate_->id()); | 86 collection_->RemoveById(delegate_->id()); |
87 visible_ = false; | 87 visible_ = false; |
88 urgent_ = false; | 88 urgent_ = false; |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 } // namespace chromeos | 92 } // namespace chromeos |
OLD | NEW |