Chromium Code Reviews| 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/autofill_cc_infobar_delegate.h" | 9 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
| 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 const base::Closure& save_card_callback) { | 82 const base::Closure& save_card_callback) { |
| 83 InfoBarService* infobar_service = | 83 InfoBarService* infobar_service = |
| 84 InfoBarService::FromWebContents(web_contents_); | 84 InfoBarService::FromWebContents(web_contents_); |
| 85 AutofillCCInfoBarDelegate::Create( | 85 AutofillCCInfoBarDelegate::Create( |
| 86 infobar_service, &metric_logger, save_card_callback); | 86 infobar_service, &metric_logger, save_card_callback); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void TabAutofillManagerDelegate::ShowRequestAutocompleteDialog( | 89 void TabAutofillManagerDelegate::ShowRequestAutocompleteDialog( |
| 90 const FormData& form, | 90 const FormData& form, |
| 91 const GURL& source_url, | 91 const GURL& source_url, |
| 92 DialogType dialog_type, | |
| 93 const base::Callback<void(const FormStructure*, | 92 const base::Callback<void(const FormStructure*, |
| 94 const std::string&)>& callback) { | 93 const std::string&)>& callback) { |
| 95 HideRequestAutocompleteDialog(); | 94 HideRequestAutocompleteDialog(); |
| 96 | 95 |
| 97 dialog_controller_ = AutofillDialogController::Create(web_contents_, | 96 dialog_controller_ = AutofillDialogController::Create(web_contents_, |
| 98 form, | 97 form, |
| 99 source_url, | 98 source_url, |
| 100 dialog_type, | |
| 101 callback); | 99 callback); |
| 102 if (dialog_controller_) { | 100 if (dialog_controller_) { |
| 103 dialog_controller_->Show(); | 101 dialog_controller_->Show(); |
| 104 } else { | 102 } else { |
| 105 callback.Run(NULL, std::string()); | 103 callback.Run(NULL, std::string()); |
| 106 NOTIMPLEMENTED(); | 104 NOTIMPLEMENTED(); |
| 107 } | 105 } |
| 108 } | 106 } |
| 109 | 107 |
| 110 void TabAutofillManagerDelegate::ShowAutofillPopup( | 108 void TabAutofillManagerDelegate::ShowAutofillPopup( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 return; | 158 return; |
| 161 host->Send(new AutofillMsg_PageShown(host->GetRoutingID())); | 159 host->Send(new AutofillMsg_PageShown(host->GetRoutingID())); |
| 162 } | 160 } |
| 163 | 161 |
| 164 void TabAutofillManagerDelegate::DidNavigateMainFrame( | 162 void TabAutofillManagerDelegate::DidNavigateMainFrame( |
| 165 const content::LoadCommittedDetails& details, | 163 const content::LoadCommittedDetails& details, |
| 166 const content::FrameNavigateParams& params) { | 164 const content::FrameNavigateParams& params) { |
| 167 if (!dialog_controller_.get()) | 165 if (!dialog_controller_.get()) |
| 168 return; | 166 return; |
| 169 | 167 |
| 170 bool was_redirect = details.entry && | 168 HideRequestAutocompleteDialog(); |
| 171 content::PageTransitionIsRedirect(details.entry->GetTransitionType()); | |
|
Ilya Sherman
2013/09/03 20:57:05
nit: Are there any #included headers that are no l
Raman Kakilate
2013/09/03 21:50:31
Done.
| |
| 172 | |
| 173 if (dialog_controller_->GetDialogType() == DIALOG_TYPE_REQUEST_AUTOCOMPLETE || | |
| 174 !was_redirect) { | |
| 175 HideRequestAutocompleteDialog(); | |
| 176 } | |
| 177 } | 169 } |
| 178 | 170 |
| 179 void TabAutofillManagerDelegate::WebContentsDestroyed( | 171 void TabAutofillManagerDelegate::WebContentsDestroyed( |
| 180 content::WebContents* web_contents) { | 172 content::WebContents* web_contents) { |
| 181 HideAutofillPopup(); | 173 HideAutofillPopup(); |
| 182 } | 174 } |
| 183 | 175 |
| 184 } // namespace autofill | 176 } // namespace autofill |
| OLD | NEW |