OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/autofill/tab_autofill_manager_delegate.h" | 5 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/autofill/autocheckout_whitelist_manager_factory.h" | 9 #include "chrome/browser/autofill/autocheckout_whitelist_manager_factory.h" |
10 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" | 10 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (autocheckout_bubble_.get()) | 135 if (autocheckout_bubble_.get()) |
136 autocheckout_bubble_->HideBubble(); | 136 autocheckout_bubble_->HideBubble(); |
137 } | 137 } |
138 | 138 |
139 void TabAutofillManagerDelegate::ShowRequestAutocompleteDialog( | 139 void TabAutofillManagerDelegate::ShowRequestAutocompleteDialog( |
140 const FormData& form, | 140 const FormData& form, |
141 const GURL& source_url, | 141 const GURL& source_url, |
142 DialogType dialog_type, | 142 DialogType dialog_type, |
143 const base::Callback<void(const FormStructure*, | 143 const base::Callback<void(const FormStructure*, |
144 const std::string&)>& callback) { | 144 const std::string&)>& callback) { |
| 145 #if defined(ENABLE_AUTOFILL_DIALOG) |
145 HideRequestAutocompleteDialog(); | 146 HideRequestAutocompleteDialog(); |
146 | 147 |
147 dialog_controller_ = AutofillDialogControllerImpl::Create(web_contents_, | 148 dialog_controller_ = AutofillDialogControllerImpl::Create(web_contents_, |
148 form, | 149 form, |
149 source_url, | 150 source_url, |
150 dialog_type, | 151 dialog_type, |
151 callback); | 152 callback); |
152 dialog_controller_->Show(); | 153 dialog_controller_->Show(); |
| 154 #else |
| 155 callback.Run(NULL, std::string()); |
| 156 NOTIMPLEMENTED(); |
| 157 #endif // #if !defined(ENABLE_AUTOFILL_DIALOG) |
153 } | 158 } |
154 | 159 |
155 void TabAutofillManagerDelegate::ShowAutofillPopup( | 160 void TabAutofillManagerDelegate::ShowAutofillPopup( |
156 const gfx::RectF& element_bounds, | 161 const gfx::RectF& element_bounds, |
157 base::i18n::TextDirection text_direction, | 162 base::i18n::TextDirection text_direction, |
158 const std::vector<string16>& values, | 163 const std::vector<string16>& values, |
159 const std::vector<string16>& labels, | 164 const std::vector<string16>& labels, |
160 const std::vector<string16>& icons, | 165 const std::vector<string16>& icons, |
161 const std::vector<int>& identifiers, | 166 const std::vector<int>& identifiers, |
162 base::WeakPtr<AutofillPopupDelegate> delegate) { | 167 base::WeakPtr<AutofillPopupDelegate> delegate) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 HideRequestAutocompleteDialog(); | 236 HideRequestAutocompleteDialog(); |
232 } | 237 } |
233 } | 238 } |
234 | 239 |
235 void TabAutofillManagerDelegate::WebContentsDestroyed( | 240 void TabAutofillManagerDelegate::WebContentsDestroyed( |
236 content::WebContents* web_contents) { | 241 content::WebContents* web_contents) { |
237 HideAutofillPopup(); | 242 HideAutofillPopup(); |
238 } | 243 } |
239 | 244 |
240 } // namespace autofill | 245 } // namespace autofill |
OLD | NEW |