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

Side by Side Diff: chrome/browser/extensions/api/notifications/extension_notification_handler.cc

Issue 2917923004: Move handler processing to NotificationDisplayService
Patch Set: Created 3 years, 6 months 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698