OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/save_card_bubble_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "chrome/browser/ui/autofill/save_card_bubble_view.h" | 9 #include "chrome/browser/ui/autofill/save_card_bubble_view.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 void SaveCardBubbleControllerImpl::DidFinishNavigation( | 166 void SaveCardBubbleControllerImpl::DidFinishNavigation( |
167 content::NavigationHandle* navigation_handle) { | 167 content::NavigationHandle* navigation_handle) { |
168 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) | 168 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) |
169 return; | 169 return; |
170 | 170 |
171 // Nothing to do if there's no bubble available. | 171 // Nothing to do if there's no bubble available. |
172 if (save_card_callback_.is_null()) | 172 if (save_card_callback_.is_null()) |
173 return; | 173 return; |
174 | 174 |
175 // Don't react to in-page (fragment) navigations. | 175 // Don't react to same-document (fragment) navigations. |
176 if (navigation_handle->IsSamePage()) | 176 if (navigation_handle->IsSameDocument()) |
177 return; | 177 return; |
178 | 178 |
179 // Don't do anything if a navigation occurs before a user could reasonably | 179 // Don't do anything if a navigation occurs before a user could reasonably |
180 // interact with the bubble. | 180 // interact with the bubble. |
181 if (Elapsed() < base::TimeDelta::FromSeconds(kSurviveNavigationSeconds)) | 181 if (Elapsed() < base::TimeDelta::FromSeconds(kSurviveNavigationSeconds)) |
182 return; | 182 return; |
183 | 183 |
184 // Otherwise, get rid of the bubble and icon. | 184 // Otherwise, get rid of the bubble and icon. |
185 save_card_callback_.Reset(); | 185 save_card_callback_.Reset(); |
186 if (save_card_bubble_view_) { | 186 if (save_card_bubble_view_) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 location_bar->UpdateSaveCreditCardIcon(); | 228 location_bar->UpdateSaveCreditCardIcon(); |
229 } | 229 } |
230 | 230 |
231 void SaveCardBubbleControllerImpl::OpenUrl(const GURL& url) { | 231 void SaveCardBubbleControllerImpl::OpenUrl(const GURL& url) { |
232 web_contents()->OpenURL(content::OpenURLParams( | 232 web_contents()->OpenURL(content::OpenURLParams( |
233 url, content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, | 233 url, content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, |
234 ui::PAGE_TRANSITION_LINK, false)); | 234 ui::PAGE_TRANSITION_LINK, false)); |
235 } | 235 } |
236 | 236 |
237 } // namespace autofill | 237 } // namespace autofill |
OLD | NEW |