| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_TEST_AUTOMATION_AUTOCOMPLETE_EDIT_PROXY_H__ | 5 #ifndef CHROME_TEST_AUTOMATION_AUTOCOMPLETE_EDIT_PROXY_H__ |
| 6 #define CHROME_TEST_AUTOMATION_AUTOCOMPLETE_EDIT_PROXY_H__ | 6 #define CHROME_TEST_AUTOMATION_AUTOCOMPLETE_EDIT_PROXY_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 size_t inline_autocomplete_offset; | 42 size_t inline_autocomplete_offset; |
| 43 GURL destination_url; | 43 GURL destination_url; |
| 44 std::wstring contents; | 44 std::wstring contents; |
| 45 std::wstring description; | 45 std::wstring description; |
| 46 bool is_history_what_you_typed_match; | 46 bool is_history_what_you_typed_match; |
| 47 std::string type; | 47 std::string type; |
| 48 bool starred; | 48 bool starred; |
| 49 }; | 49 }; |
| 50 typedef std::vector<AutocompleteMatchData> Matches; | 50 typedef std::vector<AutocompleteMatchData> Matches; |
| 51 | 51 |
| 52 namespace IPC { | |
| 53 | |
| 54 template <> | 52 template <> |
| 55 struct ParamTraits<AutocompleteMatchData> { | 53 struct ParamTraits<AutocompleteMatchData> { |
| 56 typedef AutocompleteMatchData param_type; | 54 typedef AutocompleteMatchData param_type; |
| 57 static void Write(Message* m, const param_type& p) { | 55 static void Write(IPC::Message* m, const param_type& p) { |
| 58 m->WriteString(p.provider_name); | 56 m->WriteString(p.provider_name); |
| 59 m->WriteInt(p.relevance); | 57 m->WriteInt(p.relevance); |
| 60 m->WriteBool(p.deletable); | 58 m->WriteBool(p.deletable); |
| 61 m->WriteWString(p.fill_into_edit); | 59 m->WriteWString(p.fill_into_edit); |
| 62 m->WriteSize(p.inline_autocomplete_offset); | 60 m->WriteSize(p.inline_autocomplete_offset); |
| 63 m->WriteString(p.destination_url.possibly_invalid_spec()); | 61 m->WriteString(p.destination_url.possibly_invalid_spec()); |
| 64 m->WriteWString(p.contents); | 62 m->WriteWString(p.contents); |
| 65 m->WriteWString(p.description); | 63 m->WriteWString(p.description); |
| 66 m->WriteBool(p.is_history_what_you_typed_match); | 64 m->WriteBool(p.is_history_what_you_typed_match); |
| 67 m->WriteString(p.type); | 65 m->WriteString(p.type); |
| 68 m->WriteBool(p.starred); | 66 m->WriteBool(p.starred); |
| 69 } | 67 } |
| 70 | 68 |
| 71 static bool Read(const Message* m, void** iter, param_type* r) { | 69 static bool Read(const IPC::Message* m, void** iter, param_type* r) { |
| 72 std::string destination_url; | 70 std::string destination_url; |
| 73 if (!m->ReadString(iter, &r->provider_name) || | 71 if (!m->ReadString(iter, &r->provider_name) || |
| 74 !m->ReadInt(iter, &r->relevance) || | 72 !m->ReadInt(iter, &r->relevance) || |
| 75 !m->ReadBool(iter, &r->deletable) || | 73 !m->ReadBool(iter, &r->deletable) || |
| 76 !m->ReadWString(iter, &r->fill_into_edit) || | 74 !m->ReadWString(iter, &r->fill_into_edit) || |
| 77 !m->ReadSize(iter, &r->inline_autocomplete_offset) || | 75 !m->ReadSize(iter, &r->inline_autocomplete_offset) || |
| 78 !m->ReadString(iter, &destination_url) || | 76 !m->ReadString(iter, &destination_url) || |
| 79 !m->ReadWString(iter, &r->contents) || | 77 !m->ReadWString(iter, &r->contents) || |
| 80 !m->ReadWString(iter, &r->description) || | 78 !m->ReadWString(iter, &r->description) || |
| 81 !m->ReadBool(iter, &r->is_history_what_you_typed_match) || | 79 !m->ReadBool(iter, &r->is_history_what_you_typed_match) || |
| (...skipping 23 matching lines...) Expand all Loading... |
| 105 l->append(p.description); | 103 l->append(p.description); |
| 106 l->append(L" "); | 104 l->append(L" "); |
| 107 l->append(p.is_history_what_you_typed_match ? L"true" : L"false"); | 105 l->append(p.is_history_what_you_typed_match ? L"true" : L"false"); |
| 108 l->append(L" "); | 106 l->append(L" "); |
| 109 l->append(UTF8ToWide(p.type)); | 107 l->append(UTF8ToWide(p.type)); |
| 110 l->append(L" "); | 108 l->append(L" "); |
| 111 l->append(p.starred ? L"true" : L"false"); | 109 l->append(p.starred ? L"true" : L"false"); |
| 112 l->append(L"]"); | 110 l->append(L"]"); |
| 113 } | 111 } |
| 114 }; | 112 }; |
| 115 } // namespace IPC | |
| 116 | 113 |
| 117 class AutocompleteEditProxy : public AutomationResourceProxy { | 114 class AutocompleteEditProxy : public AutomationResourceProxy { |
| 118 public: | 115 public: |
| 119 AutocompleteEditProxy(AutomationMessageSender* sender, | 116 AutocompleteEditProxy(AutomationMessageSender* sender, |
| 120 AutomationHandleTracker* tracker, | 117 AutomationHandleTracker* tracker, |
| 121 int handle) | 118 int handle) |
| 122 : AutomationResourceProxy(tracker, sender, handle) {} | 119 : AutomationResourceProxy(tracker, sender, handle) {} |
| 123 virtual ~AutocompleteEditProxy() {} | 120 virtual ~AutocompleteEditProxy() {} |
| 124 | 121 |
| 125 // All these functions return true if the autocomplete edit is valid and | 122 // All these functions return true if the autocomplete edit is valid and |
| (...skipping 19 matching lines...) Expand all Loading... |
| 145 // to finish. Returns false if IPC call failed or if the function times out. | 142 // to finish. Returns false if IPC call failed or if the function times out. |
| 146 bool WaitForQuery(int wait_timeout_ms) const; | 143 bool WaitForQuery(int wait_timeout_ms) const; |
| 147 | 144 |
| 148 private: | 145 private: |
| 149 DISALLOW_EVIL_CONSTRUCTORS(AutocompleteEditProxy); | 146 DISALLOW_EVIL_CONSTRUCTORS(AutocompleteEditProxy); |
| 150 }; | 147 }; |
| 151 | 148 |
| 152 #endif // #define CHROME_TEST_AUTOMATION_AUTOCOMPLETE_EDIT_PROXY_H__ | 149 #endif // #define CHROME_TEST_AUTOMATION_AUTOCOMPLETE_EDIT_PROXY_H__ |
| 153 | 150 |
| 154 | 151 |
| OLD | NEW |