| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/sync_notifier/chrome_notifier_delegate.h" | 5 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" | 7 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" |
| 8 | 8 |
| 9 namespace notifier { | 9 namespace notifier { |
| 10 ChromeNotifierDelegate::ChromeNotifierDelegate(const std::string& id, | 10 ChromeNotifierDelegate::ChromeNotifierDelegate(const std::string& id, |
| 11 ChromeNotifierService* notifier) | 11 ChromeNotifierService* notifier) |
| 12 : id_(id), chrome_notifier_(notifier) {} | 12 : id_(id), chrome_notifier_(notifier) {} |
| 13 | 13 |
| 14 ChromeNotifierDelegate::~ChromeNotifierDelegate() {} | 14 ChromeNotifierDelegate::~ChromeNotifierDelegate() {} |
| 15 | 15 |
| 16 std::string ChromeNotifierDelegate::id() const { | 16 std::string ChromeNotifierDelegate::id() const { |
| 17 return id_; | 17 return id_; |
| 18 } | 18 } |
| 19 | 19 |
| 20 content::RenderViewHost* ChromeNotifierDelegate::GetRenderViewHost() const { | 20 content::RenderViewHost* ChromeNotifierDelegate::GetRenderViewHost() const { |
| 21 return NULL; | 21 return NULL; |
| 22 } | 22 } |
| 23 | 23 |
| 24 void ChromeNotifierDelegate::Close(bool by_user) { | 24 void ChromeNotifierDelegate::Close(bool by_user) { |
| 25 chrome_notifier_->MarkNotificationAsDismissed(id_); | 25 if (by_user) |
| 26 chrome_notifier_->MarkNotificationAsDismissed(id_); |
| 26 } | 27 } |
| 27 | 28 |
| 28 } // namespace notifier | 29 } // namespace notifier |
| OLD | NEW |