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/api/rtc_private/rtc_private_api.h" | 5 #include "chrome/browser/extensions/api/rtc_private/rtc_private_api.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 else | 84 else |
85 email_list->Append(value); | 85 email_list->Append(value); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 } // namespace | 89 } // namespace |
90 | 90 |
91 void RtcPrivateEventRouter::DispatchLaunchEvent( | 91 void RtcPrivateEventRouter::DispatchLaunchEvent( |
92 Profile* profile, LaunchAction action, const Contact* contact) { | 92 Profile* profile, LaunchAction action, const Contact* contact) { |
93 if (action == RtcPrivateEventRouter::LAUNCH_ACTIVATE) { | 93 if (action == RtcPrivateEventRouter::LAUNCH_ACTIVATE) { |
94 extensions::ExtensionSystem::Get(profile)->event_router()-> | 94 scoped_ptr<Event> event(new Event( |
95 DispatchEventToRenderers( | 95 kOnLaunchEvent, make_scoped_ptr(new ListValue()))); |
96 kOnLaunchEvent, | 96 event->restrict_to_profile = profile; |
97 scoped_ptr<ListValue>(new ListValue()), | 97 ExtensionSystem::Get(profile)->event_router()->BroadcastEvent(event.Pass()); |
98 profile, | |
99 GURL()); | |
100 } else { | 98 } else { |
101 DCHECK(contact); | 99 DCHECK(contact); |
102 extensions::api::rtc_private::LaunchData launch_data; | 100 extensions::api::rtc_private::LaunchData launch_data; |
103 launch_data.intent.action = GetLaunchAction(action); | 101 launch_data.intent.action = GetLaunchAction(action); |
104 GetContactIntentData(*contact, | 102 GetContactIntentData(*contact, |
105 &launch_data.intent.data.additional_properties); | 103 &launch_data.intent.data.additional_properties); |
106 launch_data.intent.type = kMimeTypeJson; | 104 launch_data.intent.type = kMimeTypeJson; |
107 extensions::ExtensionSystem::Get(profile)->event_router()-> | 105 scoped_ptr<Event> event(new Event( |
108 DispatchEventToRenderers( | 106 kOnLaunchEvent, api::rtc_private::OnLaunch::Create(launch_data))); |
109 kOnLaunchEvent, | 107 event->restrict_to_profile = profile; |
110 extensions::api::rtc_private::OnLaunch::Create(launch_data), | 108 ExtensionSystem::Get(profile)->event_router()->BroadcastEvent(event.Pass()); |
111 profile, | |
112 GURL()); | |
113 } | 109 } |
114 } | 110 } |
115 | 111 |
116 } // namespace extensions | 112 } // namespace extensions |
OLD | NEW |