Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: ios/chrome/browser/passwords/password_controller.mm

Issue 2466143002: iOS: Mark HTTP pages with password fields with an omnibox icon. (Closed)
Patch Set: iOS HTTP Bad. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/passwords/password_controller_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "ios/chrome/browser/passwords/password_controller.h" 5 #import "ios/chrome/browser/passwords/password_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 21 matching lines...) Expand all
32 #include "components/password_manager/core/browser/password_manager_driver.h" 32 #include "components/password_manager/core/browser/password_manager_driver.h"
33 #include "components/sync/driver/sync_service.h" 33 #include "components/sync/driver/sync_service.h"
34 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 34 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
35 #include "ios/chrome/browser/experimental_flags.h" 35 #include "ios/chrome/browser/experimental_flags.h"
36 #include "ios/chrome/browser/infobars/infobar_manager_impl.h" 36 #include "ios/chrome/browser/infobars/infobar_manager_impl.h"
37 #import "ios/chrome/browser/passwords/ios_chrome_save_password_infobar_delegate. h" 37 #import "ios/chrome/browser/passwords/ios_chrome_save_password_infobar_delegate. h"
38 #import "ios/chrome/browser/passwords/ios_chrome_update_password_infobar_delegat e.h" 38 #import "ios/chrome/browser/passwords/ios_chrome_update_password_infobar_delegat e.h"
39 #import "ios/chrome/browser/passwords/js_password_manager.h" 39 #import "ios/chrome/browser/passwords/js_password_manager.h"
40 #import "ios/chrome/browser/passwords/password_generation_agent.h" 40 #import "ios/chrome/browser/passwords/password_generation_agent.h"
41 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" 41 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h"
42 #import "ios/web/public/origin_util.h"
42 #include "ios/web/public/url_scheme_util.h" 43 #include "ios/web/public/url_scheme_util.h"
43 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" 44 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
44 #import "ios/web/public/web_state/web_state.h" 45 #import "ios/web/public/web_state/web_state.h"
45 #include "url/gurl.h" 46 #include "url/gurl.h"
46 47
47 using password_manager::PasswordFormManager; 48 using password_manager::PasswordFormManager;
48 using password_manager::PasswordGenerationManager; 49 using password_manager::PasswordGenerationManager;
49 using password_manager::PasswordManager; 50 using password_manager::PasswordManager;
50 using password_manager::PasswordManagerClient; 51 using password_manager::PasswordManagerClient;
51 using password_manager::PasswordManagerDriver; 52 using password_manager::PasswordManagerDriver;
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 pageURL:pageURL]; 542 pageURL:pageURL];
542 } 543 }
543 544
544 - (void)didFinishPasswordFormExtraction: 545 - (void)didFinishPasswordFormExtraction:
545 (const std::vector<autofill::PasswordForm>&)forms { 546 (const std::vector<autofill::PasswordForm>&)forms {
546 // Do nothing if |self| has been detached. 547 // Do nothing if |self| has been detached.
547 if (!passwordManager_) 548 if (!passwordManager_)
548 return; 549 return;
549 550
550 if (!forms.empty()) { 551 if (!forms.empty()) {
552 // Notify web_state about password forms, so that this can be taken into
553 // account for the security state.
554 if (webStateObserverBridge_) {
555 web::WebState* web_state = webStateObserverBridge_->web_state();
556 if (web_state && !web::IsOriginSecure(web_state->GetLastCommittedURL())) {
557 web_state->OnPasswordInputShownOnHttp();
558 }
559 }
560
551 // Invoke the password manager callback to autofill password forms 561 // Invoke the password manager callback to autofill password forms
552 // on the loaded page. 562 // on the loaded page.
553 passwordManager_->OnPasswordFormsParsed(passwordManagerDriver_.get(), 563 passwordManager_->OnPasswordFormsParsed(passwordManagerDriver_.get(),
554 forms); 564 forms);
555 565
556 // Pass the forms to PasswordGenerationAgent to look for account creation 566 // Pass the forms to PasswordGenerationAgent to look for account creation
557 // forms with local heuristics. 567 // forms with local heuristics.
558 [passwordGenerationAgent_ processParsedPasswordForms:forms]; 568 [passwordGenerationAgent_ processParsedPasswordForms:forms];
559 } 569 }
560 // Invoke the password manager callback to check if password was 570 // Invoke the password manager callback to check if password was
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 break; 875 break;
866 876
867 case PasswordInfoBarType::UPDATE: 877 case PasswordInfoBarType::UPDATE:
868 IOSChromeUpdatePasswordInfoBarDelegate::Create( 878 IOSChromeUpdatePasswordInfoBarDelegate::Create(
869 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); 879 isSmartLockBrandingEnabled, infoBarManager, std::move(form));
870 break; 880 break;
871 } 881 }
872 } 882 }
873 883
874 @end 884 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/passwords/password_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698