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

Side by Side Diff: components/autofill/content/browser/autofill_driver_impl.cc

Issue 17382007: Move IPC reception handling from AutofillManager to AutofillDriverImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after conflict Created 7 years, 6 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
« no previous file with comments | « no previous file | components/autofill/core/browser/autocomplete_history_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/autofill/content/browser/autofill_driver_impl.h" 5 #include "components/autofill/content/browser/autofill_driver_impl.h"
6 6
7 #include "components/autofill/core/browser/autofill_external_delegate.h" 7 #include "components/autofill/core/browser/autofill_external_delegate.h"
8 #include "components/autofill/core/browser/autofill_manager.h" 8 #include "components/autofill/core/browser/autofill_manager.h"
9 #include "components/autofill/core/browser/autofill_manager_delegate.h" 9 #include "components/autofill/core/browser/autofill_manager_delegate.h"
10 #include "components/autofill/core/common/autofill_messages.h"
11 #include "content/public/browser/navigation_details.h"
10 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "content/public/common/frame_navigate_params.h"
14 #include "ipc/ipc_message_macros.h"
11 15
12 namespace autofill { 16 namespace autofill {
13 17
14 namespace { 18 namespace {
15 19
16 const char kAutofillDriverImplWebContentsUserDataKey[] = 20 const char kAutofillDriverImplWebContentsUserDataKey[] =
17 "web_contents_autofill_driver_impl"; 21 "web_contents_autofill_driver_impl";
18 22
19 } // namespace 23 } // namespace
20 24
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 66 }
63 } 67 }
64 68
65 AutofillDriverImpl::~AutofillDriverImpl() {} 69 AutofillDriverImpl::~AutofillDriverImpl() {}
66 70
67 content::WebContents* AutofillDriverImpl::GetWebContents() { 71 content::WebContents* AutofillDriverImpl::GetWebContents() {
68 return web_contents(); 72 return web_contents();
69 } 73 }
70 74
71 bool AutofillDriverImpl::OnMessageReceived(const IPC::Message& message) { 75 bool AutofillDriverImpl::OnMessageReceived(const IPC::Message& message) {
72 // TODO(blundell): Move IPC handling into this class. 76 bool handled = true;
73 return autofill_manager_.OnMessageReceived(message); 77 IPC_BEGIN_MESSAGE_MAP(AutofillDriverImpl, message)
78 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormsSeen, &autofill_manager_,
79 AutofillManager::OnFormsSeen)
80 IPC_MESSAGE_FORWARD(AutofillHostMsg_FormSubmitted, &autofill_manager_,
81 AutofillManager::OnFormSubmitted)
82 IPC_MESSAGE_FORWARD(AutofillHostMsg_TextFieldDidChange, &autofill_manager_,
83 AutofillManager::OnTextFieldDidChange)
84 IPC_MESSAGE_FORWARD(AutofillHostMsg_QueryFormFieldAutofill,
85 &autofill_manager_,
86 AutofillManager::OnQueryFormFieldAutofill)
87 IPC_MESSAGE_FORWARD(AutofillHostMsg_ShowAutofillDialog, &autofill_manager_,
88 AutofillManager::OnShowAutofillDialog)
89 IPC_MESSAGE_FORWARD(AutofillHostMsg_FillAutofillFormData,
90 &autofill_manager_,
91 AutofillManager::OnFillAutofillFormData)
92 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidPreviewAutofillFormData,
93 &autofill_manager_,
94 AutofillManager::OnDidPreviewAutofillFormData)
95 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidFillAutofillFormData,
96 &autofill_manager_,
97 AutofillManager::OnDidFillAutofillFormData)
98 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidShowAutofillSuggestions,
99 &autofill_manager_,
100 AutofillManager::OnDidShowAutofillSuggestions)
101 IPC_MESSAGE_FORWARD(AutofillHostMsg_DidEndTextFieldEditing,
102 &autofill_manager_,
103 AutofillManager::OnDidEndTextFieldEditing)
104 IPC_MESSAGE_FORWARD(AutofillHostMsg_HideAutofillUi, &autofill_manager_,
105 AutofillManager::OnHideAutofillUi)
106 IPC_MESSAGE_FORWARD(AutofillHostMsg_AddPasswordFormMapping,
107 &autofill_manager_,
108 AutofillManager::OnAddPasswordFormMapping)
109 IPC_MESSAGE_FORWARD(AutofillHostMsg_ShowPasswordSuggestions,
110 &autofill_manager_,
111 AutofillManager::OnShowPasswordSuggestions)
112 IPC_MESSAGE_FORWARD(AutofillHostMsg_SetDataList, &autofill_manager_,
113 AutofillManager::OnSetDataList)
114 IPC_MESSAGE_FORWARD(AutofillHostMsg_RequestAutocomplete,
115 &autofill_manager_,
116 AutofillManager::OnRequestAutocomplete)
117 IPC_MESSAGE_FORWARD(AutofillHostMsg_ClickFailed, &autofill_manager_,
118 AutofillManager::OnClickFailed)
119 IPC_MESSAGE_FORWARD(AutofillHostMsg_MaybeShowAutocheckoutBubble,
120 &autofill_manager_,
121 AutofillManager::OnMaybeShowAutocheckoutBubble)
122 IPC_MESSAGE_FORWARD(AutofillHostMsg_RemoveAutocompleteEntry,
123 &autofill_manager_,
124 AutofillManager::RemoveAutocompleteEntry)
125 IPC_MESSAGE_UNHANDLED(handled = false)
126 IPC_END_MESSAGE_MAP()
127 return handled;
74 } 128 }
75 129
76 void AutofillDriverImpl::DidNavigateMainFrame( 130 void AutofillDriverImpl::DidNavigateMainFrame(
77 const content::LoadCommittedDetails& details, 131 const content::LoadCommittedDetails& details,
78 const content::FrameNavigateParams& params) { 132 const content::FrameNavigateParams& params) {
79 // TODO(blundell): Move the logic of this method into this class. 133 if (details.is_navigation_to_different_page())
80 autofill_manager_.DidNavigateMainFrame(details, params); 134 autofill_manager_.Reset();
81 } 135 }
82 136
83 void AutofillDriverImpl::SetAutofillExternalDelegate( 137 void AutofillDriverImpl::SetAutofillExternalDelegate(
84 scoped_ptr<AutofillExternalDelegate> delegate) { 138 scoped_ptr<AutofillExternalDelegate> delegate) {
85 autofill_external_delegate_.reset(delegate.release()); 139 autofill_external_delegate_.reset(delegate.release());
86 autofill_manager_.SetExternalDelegate(autofill_external_delegate_.get()); 140 autofill_manager_.SetExternalDelegate(autofill_external_delegate_.get());
87 } 141 }
88 142
89 } // namespace autofill 143 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/autocomplete_history_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698