| 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/download/notification/download_item_notification.h" | 5 #include "chrome/browser/download/notification/download_item_notification.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return download_item_notification_->OnNotificationButtonClick(index); | 156 return download_item_notification_->OnNotificationButtonClick(index); |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool ShownAsPopUp() { | 159 bool ShownAsPopUp() { |
| 160 return !notification()->shown_as_popup(); | 160 return !notification()->shown_as_popup(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void CreateDownloadItemNotification() { | 163 void CreateDownloadItemNotification() { |
| 164 download_notification_manager_->OnNewDownloadReady(download_item_.get()); | 164 download_notification_manager_->OnNewDownloadReady(download_item_.get()); |
| 165 download_item_notification_ = | 165 download_item_notification_ = |
| 166 download_notification_manager_->items_[download_item_.get()]; | 166 download_notification_manager_->items_[download_item_.get()].get(); |
| 167 message_center_->AddVisibleNotification( | 167 message_center_->AddVisibleNotification( |
| 168 download_item_notification_->notification_.get()); | 168 download_item_notification_->notification_.get()); |
| 169 } | 169 } |
| 170 | 170 |
| 171 base::MessageLoopForUI message_loop_; | 171 base::MessageLoopForUI message_loop_; |
| 172 content::TestBrowserThread ui_thread_; | 172 content::TestBrowserThread ui_thread_; |
| 173 | 173 |
| 174 std::unique_ptr<TestingProfileManager> profile_manager_; | 174 std::unique_ptr<TestingProfileManager> profile_manager_; |
| 175 Profile* profile_; | 175 Profile* profile_; |
| 176 | 176 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 EXPECT_CALL(*download_item_, GetState()) | 296 EXPECT_CALL(*download_item_, GetState()) |
| 297 .WillRepeatedly(Return(content::DownloadItem::COMPLETE)); | 297 .WillRepeatedly(Return(content::DownloadItem::COMPLETE)); |
| 298 EXPECT_CALL(*download_item_, IsDone()).WillRepeatedly(Return(true)); | 298 EXPECT_CALL(*download_item_, IsDone()).WillRepeatedly(Return(true)); |
| 299 download_item_->NotifyObserversDownloadUpdated(); | 299 download_item_->NotifyObserversDownloadUpdated(); |
| 300 | 300 |
| 301 // Priority is updated back to normal. | 301 // Priority is updated back to normal. |
| 302 EXPECT_EQ(message_center::DEFAULT_PRIORITY, notification()->priority()); | 302 EXPECT_EQ(message_center::DEFAULT_PRIORITY, notification()->priority()); |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace test | 305 } // namespace test |
| OLD | NEW |