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

Side by Side Diff: chrome/browser/chromeos/login/account_creation_view.cc

Issue 6625087: Convert autofill messages to use the new IPC macros (again). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/chromeos/login/account_creation_view.h" 5 #include "chrome/browser/chromeos/login/account_creation_view.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/common/autofill_messages.h" 8 #include "chrome/common/autofill_messages.h"
9 #include "webkit/glue/form_data.h" 9 #include "webkit/glue/form_data.h"
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 return true; 44 return true;
45 return TabContents::OnMessageReceived(message); 45 return TabContents::OnMessageReceived(message);
46 } 46 }
47 47
48 private: 48 private:
49 void OnFormSubmitted(const FormData& form) { 49 void OnFormSubmitted(const FormData& form) {
50 if (UTF16ToASCII(form.name) == kCreateAccountFormName) { 50 if (UTF16ToASCII(form.name) == kCreateAccountFormName) {
51 std::string user_name; 51 std::string user_name;
52 std::string domain; 52 std::string domain;
53 for (size_t i = 0; i < form.fields.size(); i++) { 53 for (size_t i = 0; i < form.fields.size(); i++) {
54 std::string name = UTF16ToASCII(form.fields[i].name()); 54 std::string name = UTF16ToASCII(form.fields[i].name);
55 if (name == kEmailFieldName) { 55 if (name == kEmailFieldName) {
56 user_name = UTF16ToASCII(form.fields[i].value()); 56 user_name = UTF16ToASCII(form.fields[i].value);
57 } else if (name == kDomainFieldName) { 57 } else if (name == kDomainFieldName) {
58 domain = UTF16ToASCII(form.fields[i].value()); 58 domain = UTF16ToASCII(form.fields[i].value);
59 } 59 }
60 } 60 }
61 if (!user_name.empty()) { 61 if (!user_name.empty()) {
62 // We don't have password here because all password fields were 62 // We don't have password here because all password fields were
63 // stripped. Overriding TabContents::PasswordFormsFound also makes no 63 // stripped. Overriding TabContents::PasswordFormsFound also makes no
64 // sense because password value is always empty for account create page. 64 // sense because password value is always empty for account create page.
65 delegate_->OnUserCreated(user_name + "@" + domain, ""); 65 delegate_->OnUserCreated(user_name + "@" + domain, "");
66 } 66 }
67 } 67 }
68 } 68 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 AccountCreationView::~AccountCreationView() { 107 AccountCreationView::~AccountCreationView() {
108 } 108 }
109 109
110 void AccountCreationView::SetAccountCreationViewDelegate( 110 void AccountCreationView::SetAccountCreationViewDelegate(
111 AccountCreationViewDelegate* delegate) { 111 AccountCreationViewDelegate* delegate) {
112 dom_view_->SetAccountCreationViewDelegate(delegate); 112 dom_view_->SetAccountCreationViewDelegate(delegate);
113 } 113 }
114 114
115 } // namespace chromeos 115 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/autofill/select_control_handler_unittest.cc ('k') | chrome/browser/webdata/web_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698