Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: chrome/test/automation/autocomplete_edit_proxy.h

Issue 7104029: Automation: fix chrome/browser dependency on chrome/test headers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/automation/autocomplete_edit_proxy.h
===================================================================
--- chrome/test/automation/autocomplete_edit_proxy.h (revision 87452)
+++ chrome/test/automation/autocomplete_edit_proxy.h (working copy)
@@ -14,116 +14,11 @@
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/test/automation/automation_handle_tracker.h"
#include "googleurl/src/gurl.h"
-#include "ipc/ipc_message.h"
-#include "ipc/ipc_message_utils.h"
-// The purpose of this class is to act as a serializable version of
-// AutocompleteMatch. The reason for this class is because we don't want to
-// serialize all elements of AutocompleteMatch and we want some data from the
-// autocomplete provider without the hassle of serializing it.
-struct AutocompleteMatchData {
- public:
- AutocompleteMatchData()
- : relevance(0),
- deletable(false),
- inline_autocomplete_offset(0),
- is_history_what_you_typed_match(false),
- starred(false) {
- }
+struct AutocompleteMatchData;
- explicit AutocompleteMatchData(const AutocompleteMatch& match)
- : provider_name(match.provider->name()),
- relevance(match.relevance),
- deletable(match.deletable),
- fill_into_edit(match.fill_into_edit),
- inline_autocomplete_offset(match.inline_autocomplete_offset),
- destination_url(match.destination_url),
- contents(match.contents),
- description(match.description),
- is_history_what_you_typed_match(match.is_history_what_you_typed_match),
- type(AutocompleteMatch::TypeToString(match.type)),
- starred(match.starred) {
- }
-
- std::string provider_name;
- int relevance;
- bool deletable;
- string16 fill_into_edit;
- size_t inline_autocomplete_offset;
- GURL destination_url;
- string16 contents;
- string16 description;
- bool is_history_what_you_typed_match;
- std::string type;
- bool starred;
-};
typedef std::vector<AutocompleteMatchData> Matches;
-namespace IPC {
-
-template <>
-struct ParamTraits<AutocompleteMatchData> {
- typedef AutocompleteMatchData param_type;
- static void Write(Message* m, const param_type& p) {
- m->WriteString(p.provider_name);
- m->WriteInt(p.relevance);
- m->WriteBool(p.deletable);
- m->WriteString16(p.fill_into_edit);
- m->WriteSize(p.inline_autocomplete_offset);
- m->WriteString(p.destination_url.possibly_invalid_spec());
- m->WriteString16(p.contents);
- m->WriteString16(p.description);
- m->WriteBool(p.is_history_what_you_typed_match);
- m->WriteString(p.type);
- m->WriteBool(p.starred);
- }
-
- static bool Read(const Message* m, void** iter, param_type* r) {
- std::string destination_url;
- if (!m->ReadString(iter, &r->provider_name) ||
- !m->ReadInt(iter, &r->relevance) ||
- !m->ReadBool(iter, &r->deletable) ||
- !m->ReadString16(iter, &r->fill_into_edit) ||
- !m->ReadSize(iter, &r->inline_autocomplete_offset) ||
- !m->ReadString(iter, &destination_url) ||
- !m->ReadString16(iter, &r->contents) ||
- !m->ReadString16(iter, &r->description) ||
- !m->ReadBool(iter, &r->is_history_what_you_typed_match) ||
- !m->ReadString(iter, &r->type) ||
- !m->ReadBool(iter, &r->starred))
- return false;
- r->destination_url = GURL(destination_url);
- return true;
- }
-
- static void Log(const param_type& p, std::string* l) {
- l->append("[");
- l->append(p.provider_name);
- l->append(" ");
- l->append(base::IntToString(p.relevance));
- l->append(" ");
- l->append(p.deletable ? "true" : "false");
- l->append(" ");
- LogParam(p.fill_into_edit, l);
- l->append(" ");
- l->append(base::IntToString(p.inline_autocomplete_offset));
- l->append(" ");
- l->append(p.destination_url.spec());
- l->append(" ");
- LogParam(p.contents, l);
- l->append(" ");
- LogParam(p.description, l);
- l->append(" ");
- l->append(p.is_history_what_you_typed_match ? "true" : "false");
- l->append(" ");
- l->append(p.type);
- l->append(" ");
- l->append(p.starred ? "true" : "false");
- l->append("]");
- }
-};
-} // namespace IPC
-
class AutocompleteEditProxy : public AutomationResourceProxy {
public:
AutocompleteEditProxy(AutomationMessageSender* sender,

Powered by Google App Engine
This is Rietveld 408576698