OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/notifications/extension_notification_han
dler.h" | 5 #include "chrome/browser/extensions/api/notifications/extension_notification_han
dler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/nullable_string16.h" | 8 #include "base/strings/nullable_string16.h" |
9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
10 #include "chrome/browser/extensions/api/notifications/extension_notification_dis
play_helper.h" | 10 #include "chrome/browser/extensions/api/notifications/extension_notification_dis
play_helper.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 args->AppendString(unscoped_notification_id); | 38 args->AppendString(unscoped_notification_id); |
39 return args; | 39 return args; |
40 } | 40 } |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 ExtensionNotificationHandler::ExtensionNotificationHandler() = default; | 44 ExtensionNotificationHandler::ExtensionNotificationHandler() = default; |
45 | 45 |
46 ExtensionNotificationHandler::~ExtensionNotificationHandler() = default; | 46 ExtensionNotificationHandler::~ExtensionNotificationHandler() = default; |
47 | 47 |
| 48 void ExtensionNotificationHandler::OnShow(Profile* profile, |
| 49 const std::string& notification_id) {} |
| 50 |
48 void ExtensionNotificationHandler::OnClose(Profile* profile, | 51 void ExtensionNotificationHandler::OnClose(Profile* profile, |
49 const std::string& origin, | 52 const std::string& origin, |
50 const std::string& notification_id, | 53 const std::string& notification_id, |
51 bool by_user) { | 54 bool by_user) { |
52 EventRouter::UserGestureState gesture = | 55 EventRouter::UserGestureState gesture = |
53 by_user ? EventRouter::USER_GESTURE_ENABLED | 56 by_user ? EventRouter::USER_GESTURE_ENABLED |
54 : EventRouter::USER_GESTURE_NOT_ENABLED; | 57 : EventRouter::USER_GESTURE_NOT_ENABLED; |
55 std::string extension_id(GetExtensionId(origin)); | 58 std::string extension_id(GetExtensionId(origin)); |
56 DCHECK(!extension_id.empty()); | 59 DCHECK(!extension_id.empty()); |
57 | 60 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 if (!event_router) | 113 if (!event_router) |
111 return; | 114 return; |
112 | 115 |
113 std::unique_ptr<Event> event( | 116 std::unique_ptr<Event> event( |
114 new Event(histogram_value, event_name, std::move(args))); | 117 new Event(histogram_value, event_name, std::move(args))); |
115 event->user_gesture = user_gesture; | 118 event->user_gesture = user_gesture; |
116 event_router->DispatchEventToExtension(extension_id, std::move(event)); | 119 event_router->DispatchEventToExtension(extension_id, std::move(event)); |
117 } | 120 } |
118 | 121 |
119 } // namespace extensions | 122 } // namespace extensions |
OLD | NEW |