OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/automation/extension_port_container.h" | 5 #include "chrome/browser/automation/extension_port_container.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 tab_handle_(tab_handle) { | 29 tab_handle_(tab_handle) { |
30 service_ = automation_->profile()->GetExtensionMessageService(); | 30 service_ = automation_->profile()->GetExtensionMessageService(); |
31 DCHECK(service_); | 31 DCHECK(service_); |
32 } | 32 } |
33 | 33 |
34 ExtensionPortContainer::~ExtensionPortContainer() { | 34 ExtensionPortContainer::~ExtensionPortContainer() { |
35 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); | 35 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); |
36 | 36 |
37 if (port_id_ != -1) | 37 if (port_id_ != -1) |
38 service_->CloseChannel(port_id_); | 38 service_->CloseChannel(port_id_); |
39 | |
40 NotificationService::current()->Notify( | |
41 NotificationType::EXTENSION_PORT_DELETED_DEBUG, | |
42 Source<IPC::Message::Sender>(this), | |
43 NotificationService::NoDetails()); | |
44 } | 39 } |
45 | 40 |
46 bool ExtensionPortContainer::PostResponseToExternalPort( | 41 bool ExtensionPortContainer::PostResponseToExternalPort( |
47 const std::string& message) { | 42 const std::string& message) { |
48 return automation_->Send( | 43 return automation_->Send( |
49 new AutomationMsg_ForwardMessageToExternalHost( | 44 new AutomationMsg_ForwardMessageToExternalHost( |
50 0, tab_handle_, message, ext::kAutomationOrigin, | 45 0, tab_handle_, message, ext::kAutomationOrigin, |
51 ext::kAutomationPortResponseTarget)); | 46 ext::kAutomationPortResponseTarget)); |
52 } | 47 } |
53 | 48 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // This will delete the port and notify the other end of the disconnect. | 252 // This will delete the port and notify the other end of the disconnect. |
258 automation->RemovePortContainer(port); | 253 automation->RemovePortContainer(port); |
259 } | 254 } |
260 } else { | 255 } else { |
261 // We don't expect other messages here. | 256 // We don't expect other messages here. |
262 NOTREACHED(); | 257 NOTREACHED(); |
263 } | 258 } |
264 | 259 |
265 return true; | 260 return true; |
266 } | 261 } |
OLD | NEW |