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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
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 base::PickleIterator iter(message); |
86 if (!iter.ReadInt(&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() |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 int result_acc_obj_id) { | 400 int result_acc_obj_id) { |
401 if (!error.empty()) { | 401 if (!error.empty()) { |
402 Respond(Error(error)); | 402 Respond(Error(error)); |
403 return; | 403 return; |
404 } | 404 } |
405 | 405 |
406 Respond(OneArgument(new base::FundamentalValue(result_acc_obj_id))); | 406 Respond(OneArgument(new base::FundamentalValue(result_acc_obj_id))); |
407 } | 407 } |
408 | 408 |
409 } // namespace extensions | 409 } // namespace extensions |
OLD | NEW |