| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/api/file_system/request_file_system_notifica
tion.h" | 5 #include "chrome/browser/extensions/api/file_system/request_file_system_notifica
tion.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 writable | 51 writable |
| 52 ? IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_WRITABLE_MESSAGE | 52 ? IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_WRITABLE_MESSAGE |
| 53 : IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_MESSAGE, | 53 : IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_NOTIFICATION_MESSAGE, |
| 54 display_name); | 54 display_name); |
| 55 | 55 |
| 56 scoped_ptr<Notification> notification(new Notification( | 56 scoped_ptr<Notification> notification(new Notification( |
| 57 message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, | 57 message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, |
| 58 base::UTF8ToUTF16(extension.name()), message, | 58 base::UTF8ToUTF16(extension.name()), message, |
| 59 gfx::Image(), // Updated asynchronously later. | 59 gfx::Image(), // Updated asynchronously later. |
| 60 base::string16(), // display_source | 60 base::string16(), // display_source |
| 61 GURL(), |
| 61 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 62 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
| 62 notification_id), | 63 notification_id), |
| 63 data, delegate)); | 64 data, delegate)); |
| 64 | 65 |
| 65 return notification.Pass(); | 66 return notification.Pass(); |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace | 69 } // namespace |
| 69 | 70 |
| 70 // static | 71 // static |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 pending_notification_.reset(notification.release()); | 114 pending_notification_.reset(notification.release()); |
| 114 // If the extension icon is not known yet, then defer showing the notification | 115 // If the extension icon is not known yet, then defer showing the notification |
| 115 // until it is (from SetAppImage). | 116 // until it is (from SetAppImage). |
| 116 if (!extension_icon_.get()) | 117 if (!extension_icon_.get()) |
| 117 return; | 118 return; |
| 118 | 119 |
| 119 pending_notification_->set_icon(*extension_icon_.get()); | 120 pending_notification_->set_icon(*extension_icon_.get()); |
| 120 g_browser_process->message_center()->AddNotification( | 121 g_browser_process->message_center()->AddNotification( |
| 121 pending_notification_.Pass()); | 122 pending_notification_.Pass()); |
| 122 } | 123 } |
| OLD | NEW |