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/render_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 |
11 using webkit_glue::FormData; | 11 using webkit_glue::FormData; |
12 | 12 |
13 namespace chromeos { | 13 namespace chromeos { |
14 | 14 |
15 const char kCreateAccountFormName[] = "createaccount"; | 15 const char kCreateAccountFormName[] = "createaccount"; |
16 const char kEmailFieldName[] = "Email"; | 16 const char kEmailFieldName[] = "Email"; |
17 const char kDomainFieldName[] = "edk"; | 17 const char kDomainFieldName[] = "edk"; |
18 | 18 |
19 class AccountCreationTabContents : public WizardWebPageViewTabContents { | 19 class AccountCreationTabContents : public WizardWebPageViewTabContents { |
20 public: | 20 public: |
21 AccountCreationTabContents(Profile* profile, | 21 AccountCreationTabContents(Profile* profile, |
22 SiteInstance* site_instance, | 22 SiteInstance* site_instance, |
23 AccountCreationViewDelegate* delegate, | 23 AccountCreationViewDelegate* delegate, |
24 WebPageDelegate* page_delegate) | 24 WebPageDelegate* page_delegate) |
25 : WizardWebPageViewTabContents(profile, site_instance, page_delegate), | 25 : WizardWebPageViewTabContents(profile, site_instance, page_delegate), |
26 delegate_(delegate) { | 26 delegate_(delegate) { |
27 } | 27 } |
28 | 28 |
29 // Overriden from TabContents. | 29 // Overriden from TabContents. |
30 virtual bool OnMessageReceived(const IPC::Message& message) { | 30 virtual bool OnMessageReceived(const IPC::Message& message) { |
31 bool handled = true; | 31 bool handled = true; |
32 IPC_BEGIN_MESSAGE_MAP(AccountCreationTabContents, message) | 32 IPC_BEGIN_MESSAGE_MAP(AccountCreationTabContents, message) |
33 IPC_MESSAGE_HANDLER(ViewHostMsg_FormSubmitted, OnFormSubmitted) | 33 IPC_MESSAGE_HANDLER(AutoFillHostMsg_FormSubmitted, OnFormSubmitted) |
34 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_FormsSeen, ) | 34 IPC_MESSAGE_HANDLER_GENERIC(AutoFillHostMsg_FormsSeen, ) |
35 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_QueryFormFieldAutoFill, ) | 35 IPC_MESSAGE_HANDLER_GENERIC(AutoFillHostMsg_QueryFormFieldAutoFill, ) |
36 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_ShowAutoFillDialog, ) | 36 IPC_MESSAGE_HANDLER_GENERIC(AutoFillHostMsg_ShowAutoFillDialog, ) |
37 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_FillAutoFillFormData, ) | 37 IPC_MESSAGE_HANDLER_GENERIC(AutoFillHostMsg_FillAutoFillFormData, ) |
38 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_DidFillAutoFillFormData, ) | 38 IPC_MESSAGE_HANDLER_GENERIC(AutoFillHostMsg_DidFillAutoFillFormData, ) |
39 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_DidShowAutoFillSuggestions, ) | 39 IPC_MESSAGE_HANDLER_GENERIC(AutoFillHostMsg_DidShowAutoFillSuggestions, ) |
40 IPC_MESSAGE_UNHANDLED(handled = false) | 40 IPC_MESSAGE_UNHANDLED(handled = false) |
41 IPC_END_MESSAGE_MAP() | 41 IPC_END_MESSAGE_MAP() |
42 | 42 |
43 if (handled) | 43 if (handled) |
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) { |
(...skipping 56 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 |