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

Side by Side Diff: chrome/browser/autofill/autofill_manager_unittest.cc

Issue 6294016: Move AutoFill messages into a separate file. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <vector> 5 #include <vector>
6 6
7 #include "base/ref_counted.h" 7 #include "base/ref_counted.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/scoped_vector.h" 9 #include "base/scoped_vector.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 const webkit_glue::FormField& field, 472 const webkit_glue::FormField& field,
473 int unique_id) { 473 int unique_id) {
474 autofill_manager_->OnFillAutoFillFormData(query_id, form, field, unique_id); 474 autofill_manager_->OnFillAutoFillFormData(query_id, form, field, unique_id);
475 } 475 }
476 476
477 bool GetAutoFillSuggestionsMessage(int* page_id, 477 bool GetAutoFillSuggestionsMessage(int* page_id,
478 std::vector<string16>* values, 478 std::vector<string16>* values,
479 std::vector<string16>* labels, 479 std::vector<string16>* labels,
480 std::vector<string16>* icons, 480 std::vector<string16>* icons,
481 std::vector<int>* unique_ids) { 481 std::vector<int>* unique_ids) {
482 const uint32 kMsgID = ViewMsg_AutoFillSuggestionsReturned::ID; 482 const uint32 kMsgID = AutoFillMsg_SuggestionsReturned::ID;
483 const IPC::Message* message = 483 const IPC::Message* message =
484 process()->sink().GetFirstMessageMatching(kMsgID); 484 process()->sink().GetFirstMessageMatching(kMsgID);
485 if (!message) 485 if (!message)
486 return false; 486 return false;
487 487
488 AutoFillParam autofill_param; 488 AutoFillParam autofill_param;
489 ViewMsg_AutoFillSuggestionsReturned::Read(message, &autofill_param); 489 AutoFillMsg_SuggestionsReturned::Read(message, &autofill_param);
490 if (page_id) 490 if (page_id)
491 *page_id = autofill_param.a; 491 *page_id = autofill_param.a;
492 if (values) 492 if (values)
493 *values = autofill_param.b; 493 *values = autofill_param.b;
494 if (labels) 494 if (labels)
495 *labels = autofill_param.c; 495 *labels = autofill_param.c;
496 if (icons) 496 if (icons)
497 *icons = autofill_param.d; 497 *icons = autofill_param.d;
498 if (unique_ids) 498 if (unique_ids)
499 *unique_ids = autofill_param.e; 499 *unique_ids = autofill_param.e;
500 500
501 autofill_manager_->tab_contents()->autocomplete_history_manager()-> 501 autofill_manager_->tab_contents()->autocomplete_history_manager()->
502 CancelPendingQuery(); 502 CancelPendingQuery();
503 process()->sink().ClearMessages(); 503 process()->sink().ClearMessages();
504 return true; 504 return true;
505 } 505 }
506 506
507 bool GetAutoFillFormDataFilledMessage(int *page_id, FormData* results) { 507 bool GetAutoFillFormDataFilledMessage(int *page_id, FormData* results) {
508 const uint32 kMsgID = ViewMsg_AutoFillFormDataFilled::ID; 508 const uint32 kMsgID = AutoFillMsg_FormDataFilled::ID;
509 const IPC::Message* message = 509 const IPC::Message* message =
510 process()->sink().GetFirstMessageMatching(kMsgID); 510 process()->sink().GetFirstMessageMatching(kMsgID);
511 if (!message) 511 if (!message)
512 return false; 512 return false;
513 Tuple2<int, FormData> autofill_param; 513 Tuple2<int, FormData> autofill_param;
514 ViewMsg_AutoFillFormDataFilled::Read(message, &autofill_param); 514 AutoFillMsg_FormDataFilled::Read(message, &autofill_param);
515 if (page_id) 515 if (page_id)
516 *page_id = autofill_param.a; 516 *page_id = autofill_param.a;
517 if (results) 517 if (results)
518 *results = autofill_param.b; 518 *results = autofill_param.b;
519 519
520 process()->sink().ClearMessages(); 520 process()->sink().ClearMessages();
521 return true; 521 return true;
522 } 522 }
523 523
524 protected: 524 protected:
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 #else 1579 #else
1580 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( 1580 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean(
1581 prefs::kAutoFillAuxiliaryProfilesEnabled)); 1581 prefs::kAutoFillAuxiliaryProfilesEnabled));
1582 profile()->GetPrefs()->SetBoolean( 1582 profile()->GetPrefs()->SetBoolean(
1583 prefs::kAutoFillAuxiliaryProfilesEnabled, true); 1583 prefs::kAutoFillAuxiliaryProfilesEnabled, true);
1584 profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled); 1584 profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled);
1585 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( 1585 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean(
1586 prefs::kAutoFillAuxiliaryProfilesEnabled)); 1586 prefs::kAutoFillAuxiliaryProfilesEnabled));
1587 #endif 1587 #endif
1588 } 1588 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698