OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/automation_internal/automation_internal_
api.h" | 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_
api.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 ~QuerySelectorHandler() override {} | 77 ~QuerySelectorHandler() override {} |
78 | 78 |
79 bool OnMessageReceived(const IPC::Message& message) override { | 79 bool OnMessageReceived(const IPC::Message& message) override { |
80 if (message.type() != ExtensionHostMsg_AutomationQuerySelector_Result::ID) | 80 if (message.type() != ExtensionHostMsg_AutomationQuerySelector_Result::ID) |
81 return false; | 81 return false; |
82 | 82 |
83 // There may be several requests in flight; check this response matches. | 83 // There may be several requests in flight; check this response matches. |
84 int message_request_id = 0; | 84 int message_request_id = 0; |
85 PickleIterator iter(message); | 85 PickleIterator iter(message); |
86 if (!message.ReadInt(&iter, &message_request_id)) | 86 if (!iter.ReadInt(&message_request_id)) |
87 return false; | 87 return false; |
88 | 88 |
89 if (message_request_id != request_id_) | 89 if (message_request_id != request_id_) |
90 return false; | 90 return false; |
91 | 91 |
92 IPC_BEGIN_MESSAGE_MAP(QuerySelectorHandler, message) | 92 IPC_BEGIN_MESSAGE_MAP(QuerySelectorHandler, message) |
93 IPC_MESSAGE_HANDLER(ExtensionHostMsg_AutomationQuerySelector_Result, | 93 IPC_MESSAGE_HANDLER(ExtensionHostMsg_AutomationQuerySelector_Result, |
94 OnQueryResponse) | 94 OnQueryResponse) |
95 IPC_END_MESSAGE_MAP() | 95 IPC_END_MESSAGE_MAP() |
96 return true; | 96 return true; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 int result_acc_obj_id) { | 403 int result_acc_obj_id) { |
404 if (!error.empty()) { | 404 if (!error.empty()) { |
405 Respond(Error(error)); | 405 Respond(Error(error)); |
406 return; | 406 return; |
407 } | 407 } |
408 | 408 |
409 Respond(OneArgument(new base::FundamentalValue(result_acc_obj_id))); | 409 Respond(OneArgument(new base::FundamentalValue(result_acc_obj_id))); |
410 } | 410 } |
411 | 411 |
412 } // namespace extensions | 412 } // namespace extensions |
OLD | NEW |