OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/content_autofill_driver_factory.h" | 5 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "components/autofill/content/browser/content_autofill_driver.h" | 9 #include "components/autofill/content/browser/content_autofill_driver.h" |
10 #include "components/autofill/core/browser/autofill_client.h" | 10 #include "components/autofill/core/browser/autofill_client.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 void ContentAutofillDriverFactory::RenderFrameDeleted( | 84 void ContentAutofillDriverFactory::RenderFrameDeleted( |
85 content::RenderFrameHost* render_frame_host) { | 85 content::RenderFrameHost* render_frame_host) { |
86 delete frame_driver_map_[render_frame_host]; | 86 delete frame_driver_map_[render_frame_host]; |
87 frame_driver_map_.erase(render_frame_host); | 87 frame_driver_map_.erase(render_frame_host); |
88 } | 88 } |
89 | 89 |
90 void ContentAutofillDriverFactory::DidNavigateMainFrame( | 90 void ContentAutofillDriverFactory::DidNavigateMainFrame( |
91 const content::LoadCommittedDetails& details, | 91 const content::LoadCommittedDetails& details, |
92 const content::FrameNavigateParams& params) { | 92 const content::FrameNavigateParams& params) { |
| 93 // This shouldn't happen, but is causing a lot of crashes. |
| 94 // See http://crbug.com/438951 |
| 95 if (frame_driver_map_.find(web_contents()->GetMainFrame()) == |
| 96 frame_driver_map_.end()) { |
| 97 LOG(ERROR) << "Could not find ContentAutofillDriver for main frame"; |
| 98 return; |
| 99 } |
| 100 |
93 frame_driver_map_[web_contents()->GetMainFrame()]->DidNavigateFrame(details, | 101 frame_driver_map_[web_contents()->GetMainFrame()]->DidNavigateFrame(details, |
94 params); | 102 params); |
95 } | 103 } |
96 | 104 |
97 void ContentAutofillDriverFactory::NavigationEntryCommitted( | 105 void ContentAutofillDriverFactory::NavigationEntryCommitted( |
98 const content::LoadCommittedDetails& load_details) { | 106 const content::LoadCommittedDetails& load_details) { |
99 client_->HideAutofillPopup(); | 107 client_->HideAutofillPopup(); |
100 } | 108 } |
101 | 109 |
102 void ContentAutofillDriverFactory::WasHidden() { | 110 void ContentAutofillDriverFactory::WasHidden() { |
103 client_->HideAutofillPopup(); | 111 client_->HideAutofillPopup(); |
104 } | 112 } |
105 | 113 |
106 void ContentAutofillDriverFactory::CreateDriverForFrame( | 114 void ContentAutofillDriverFactory::CreateDriverForFrame( |
107 content::RenderFrameHost* render_frame_host) { | 115 content::RenderFrameHost* render_frame_host) { |
108 DCHECK(!frame_driver_map_[render_frame_host]); | 116 DCHECK(!frame_driver_map_[render_frame_host]); |
109 frame_driver_map_[render_frame_host] = new ContentAutofillDriver( | 117 frame_driver_map_[render_frame_host] = new ContentAutofillDriver( |
110 render_frame_host, client_, app_locale_, enable_download_manager_); | 118 render_frame_host, client_, app_locale_, enable_download_manager_); |
111 } | 119 } |
112 | 120 |
113 } // namespace autofill | 121 } // namespace autofill |
OLD | NEW |