| 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 "chrome/browser/ui/autofill/chrome_autofill_client.h" | 5 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, | 324 AutofillLoggerAndroid::DidFillOrPreviewField(autofilled_value, |
| 325 profile_full_name); | 325 profile_full_name); |
| 326 #endif // defined(OS_ANDROID) | 326 #endif // defined(OS_ANDROID) |
| 327 } | 327 } |
| 328 | 328 |
| 329 void ChromeAutofillClient::OnFirstUserGestureObserved() { | 329 void ChromeAutofillClient::OnFirstUserGestureObserved() { |
| 330 ContentAutofillDriverFactory* factory = | 330 ContentAutofillDriverFactory* factory = |
| 331 ContentAutofillDriverFactory::FromWebContents(web_contents()); | 331 ContentAutofillDriverFactory::FromWebContents(web_contents()); |
| 332 DCHECK(factory); | 332 DCHECK(factory); |
| 333 | 333 |
| 334 for (content::RenderFrameHost* frame : web_contents()->GetAllFrames()) { | 334 factory->OnFirstUserGestureObserved(); |
| 335 // No need to notify non-live frames. | |
| 336 // And actually they have no corresponding drivers in the factory's map. | |
| 337 if (!frame->IsRenderFrameLive()) | |
| 338 continue; | |
| 339 ContentAutofillDriver* driver = factory->DriverForFrame(frame); | |
| 340 DCHECK(driver); | |
| 341 driver->NotifyFirstUserGestureObservedInTab(); | |
| 342 } | |
| 343 } | 335 } |
| 344 | 336 |
| 345 bool ChromeAutofillClient::IsContextSecure() { | 337 bool ChromeAutofillClient::IsContextSecure() { |
| 346 content::SSLStatus ssl_status; | 338 content::SSLStatus ssl_status; |
| 347 content::NavigationEntry* navigation_entry = | 339 content::NavigationEntry* navigation_entry = |
| 348 web_contents()->GetController().GetLastCommittedEntry(); | 340 web_contents()->GetController().GetLastCommittedEntry(); |
| 349 if (!navigation_entry) | 341 if (!navigation_entry) |
| 350 return false; | 342 return false; |
| 351 | 343 |
| 352 ssl_status = navigation_entry->GetSSL(); | 344 ssl_status = navigation_entry->GetSSL(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 // directly. | 385 // directly. |
| 394 const GURL kSecurityIndicatorHelpCenterUrl( | 386 const GURL kSecurityIndicatorHelpCenterUrl( |
| 395 "https://support.google.com/chrome/?p=ui_security_indicator"); | 387 "https://support.google.com/chrome/?p=ui_security_indicator"); |
| 396 web_contents()->OpenURL(content::OpenURLParams( | 388 web_contents()->OpenURL(content::OpenURLParams( |
| 397 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), | 389 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), |
| 398 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 390 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
| 399 false /* is_renderer_initiated */)); | 391 false /* is_renderer_initiated */)); |
| 400 } | 392 } |
| 401 | 393 |
| 402 } // namespace autofill | 394 } // namespace autofill |
| OLD | NEW |