| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |