Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: chrome/browser/notifications/notification_object_proxy.cc

Issue 687183004: Remove the OnError method from notification delegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/notification_object_proxy.h" 5 #include "chrome/browser/notifications/notification_object_proxy.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "content/public/browser/desktop_notification_delegate.h" 8 #include "content/public/browser/desktop_notification_delegate.h"
9 9
10 NotificationObjectProxy::NotificationObjectProxy( 10 NotificationObjectProxy::NotificationObjectProxy(
11 scoped_ptr<content::DesktopNotificationDelegate> delegate) 11 scoped_ptr<content::DesktopNotificationDelegate> delegate)
12 : delegate_(delegate.Pass()), 12 : delegate_(delegate.Pass()),
13 displayed_(false), 13 displayed_(false),
14 id_(base::GenerateGUID()) {} 14 id_(base::GenerateGUID()) {}
15 15
16 NotificationObjectProxy::~NotificationObjectProxy() {} 16 NotificationObjectProxy::~NotificationObjectProxy() {}
17 17
18 void NotificationObjectProxy::Display() { 18 void NotificationObjectProxy::Display() {
19 // This method is called each time the notification is shown to the user 19 // This method is called each time the notification is shown to the user
20 // but we only want to fire the event the first time. 20 // but we only want to fire the event the first time.
21 if (displayed_) 21 if (displayed_)
22 return; 22 return;
23 displayed_ = true; 23 displayed_ = true;
24 24
25 delegate_->NotificationDisplayed(); 25 delegate_->NotificationDisplayed();
26 } 26 }
27 27
28 void NotificationObjectProxy::Error() {
29 delegate_->NotificationError();
30 }
31
32 void NotificationObjectProxy::Close(bool by_user) { 28 void NotificationObjectProxy::Close(bool by_user) {
33 delegate_->NotificationClosed(by_user); 29 delegate_->NotificationClosed(by_user);
34 } 30 }
35 31
36 void NotificationObjectProxy::Click() { 32 void NotificationObjectProxy::Click() {
37 delegate_->NotificationClick(); 33 delegate_->NotificationClick();
38 } 34 }
39 35
40 std::string NotificationObjectProxy::id() const { 36 std::string NotificationObjectProxy::id() const {
41 return id_; 37 return id_;
42 } 38 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_object_proxy.h ('k') | chrome/browser/notifications/notification_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698