| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "content/public/browser/render_view_host.h" | 8 #include "content/public/browser/render_view_host.h" |
| 9 | 9 |
| 10 using content::RenderViewHost; |
| 11 |
| 10 NotificationObjectProxy::NotificationObjectProxy(int process_id, int route_id, | 12 NotificationObjectProxy::NotificationObjectProxy(int process_id, int route_id, |
| 11 int notification_id, bool worker) | 13 int notification_id, bool worker) |
| 12 : process_id_(process_id), | 14 : process_id_(process_id), |
| 13 route_id_(route_id), | 15 route_id_(route_id), |
| 14 notification_id_(notification_id), | 16 notification_id_(notification_id), |
| 15 worker_(worker) { | 17 worker_(worker) { |
| 16 if (worker_) { | 18 if (worker_) { |
| 17 // TODO(johnnyg): http://crbug.com/23065 Worker support coming soon. | 19 // TODO(johnnyg): http://crbug.com/23065 Worker support coming soon. |
| 18 NOTREACHED(); | 20 NOTREACHED(); |
| 19 } | 21 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 40 void NotificationObjectProxy::Click() { | 42 void NotificationObjectProxy::Click() { |
| 41 RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_); | 43 RenderViewHost* host = RenderViewHost::FromID(process_id_, route_id_); |
| 42 if (host) | 44 if (host) |
| 43 host->DesktopNotificationPostClick(notification_id_); | 45 host->DesktopNotificationPostClick(notification_id_); |
| 44 } | 46 } |
| 45 | 47 |
| 46 std::string NotificationObjectProxy::id() const { | 48 std::string NotificationObjectProxy::id() const { |
| 47 return StringPrintf("%d:%d:%d:%d", process_id_, route_id_, | 49 return StringPrintf("%d:%d:%d:%d", process_id_, route_id_, |
| 48 notification_id_, worker_); | 50 notification_id_, worker_); |
| 49 } | 51 } |
| OLD | NEW |