OLD | NEW |
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/extensions/event_router_forwarder.h" | 5 #include "chrome/browser/extensions/event_router_forwarder.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 const std::string& extension_id, | 76 const std::string& extension_id, |
77 events::HistogramValue histogram_value, | 77 events::HistogramValue histogram_value, |
78 const std::string& event_name, | 78 const std::string& event_name, |
79 std::unique_ptr<base::ListValue> event_args, | 79 std::unique_ptr<base::ListValue> event_args, |
80 void* profile_ptr, | 80 void* profile_ptr, |
81 bool use_profile_to_restrict_events, | 81 bool use_profile_to_restrict_events, |
82 const GURL& event_url) { | 82 const GURL& event_url) { |
83 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 83 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
84 BrowserThread::PostTask( | 84 BrowserThread::PostTask( |
85 BrowserThread::UI, FROM_HERE, | 85 BrowserThread::UI, FROM_HERE, |
86 base::Bind(&EventRouterForwarder::HandleEvent, this, extension_id, | 86 base::BindOnce(&EventRouterForwarder::HandleEvent, this, extension_id, |
87 histogram_value, event_name, base::Passed(&event_args), | 87 histogram_value, event_name, base::Passed(&event_args), |
88 profile_ptr, use_profile_to_restrict_events, event_url)); | 88 profile_ptr, use_profile_to_restrict_events, event_url)); |
89 return; | 89 return; |
90 } | 90 } |
91 | 91 |
92 if (!g_browser_process || !g_browser_process->profile_manager()) | 92 if (!g_browser_process || !g_browser_process->profile_manager()) |
93 return; | 93 return; |
94 | 94 |
95 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 95 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
96 Profile* profile = NULL; | 96 Profile* profile = NULL; |
97 if (profile_ptr) { | 97 if (profile_ptr) { |
98 if (!profile_manager->IsValidProfile(profile_ptr)) | 98 if (!profile_manager->IsValidProfile(profile_ptr)) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 event->event_url = event_url; | 138 event->event_url = event_url; |
139 if (extension_id.empty()) { | 139 if (extension_id.empty()) { |
140 extensions::EventRouter::Get(profile)->BroadcastEvent(std::move(event)); | 140 extensions::EventRouter::Get(profile)->BroadcastEvent(std::move(event)); |
141 } else { | 141 } else { |
142 extensions::EventRouter::Get(profile) | 142 extensions::EventRouter::Get(profile) |
143 ->DispatchEventToExtension(extension_id, std::move(event)); | 143 ->DispatchEventToExtension(extension_id, std::move(event)); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 } // namespace extensions | 147 } // namespace extensions |
OLD | NEW |