| 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" |
| 11 #include "chrome/browser/automation/automation_provider.h" | 11 #include "chrome/browser/automation/automation_provider.h" |
| 12 #include "chrome/browser/automation/extension_automation_constants.h" | 12 #include "chrome/browser/automation/extension_automation_constants.h" |
| 13 #include "chrome/browser/browser_thread.h" | 13 #include "chrome/browser/browser_thread.h" |
| 14 #include "chrome/browser/extensions/extension_message_service.h" | 14 #include "chrome/browser/extensions/extension_message_service.h" |
| 15 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profile.h" |
| 16 #include "chrome/browser/renderer_host/render_process_host.h" | 16 #include "chrome/browser/renderer_host/render_process_host.h" |
| 17 #include "chrome/browser/renderer_host/render_view_host.h" | 17 #include "chrome/browser/renderer_host/render_view_host.h" |
| 18 #include "chrome/common/automation_messages.h" | |
| 19 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
| 20 #include "chrome/common/render_messages.h" | 19 #include "chrome/common/render_messages.h" |
| 20 #include "chrome/test/automation/automation_messages.h" |
| 21 | 21 |
| 22 // TODO(siggi): Find a more structured way to read and write JSON messages. | 22 // TODO(siggi): Find a more structured way to read and write JSON messages. |
| 23 | 23 |
| 24 namespace ext = extension_automation_constants; | 24 namespace ext = extension_automation_constants; |
| 25 | 25 |
| 26 ExtensionPortContainer::ExtensionPortContainer(AutomationProvider* automation, | 26 ExtensionPortContainer::ExtensionPortContainer(AutomationProvider* automation, |
| 27 int tab_handle) : | 27 int tab_handle) : |
| 28 automation_(automation), service_(NULL), port_id_(-1), | 28 automation_(automation), service_(NULL), port_id_(-1), |
| 29 tab_handle_(tab_handle) { | 29 tab_handle_(tab_handle) { |
| 30 service_ = automation_->profile()->GetExtensionMessageService(); | 30 service_ = automation_->profile()->GetExtensionMessageService(); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // 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. |
| 253 automation->RemovePortContainer(port); | 253 automation->RemovePortContainer(port); |
| 254 } | 254 } |
| 255 } else { | 255 } else { |
| 256 // We don't expect other messages here. | 256 // We don't expect other messages here. |
| 257 NOTREACHED(); | 257 NOTREACHED(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 return true; | 260 return true; |
| 261 } | 261 } |
| OLD | NEW |