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

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
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 24 matching lines...) Expand all
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 #include "ios/web/public/url_scheme_util.h" 42 #include "ios/web/public/url_scheme_util.h"
43 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" 43 #import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
44 #import "ios/web/public/web_state/web_state.h" 44 #import "ios/web/public/web_state/web_state.h"
45 #include "ios/web/web_state/web_state_impl.h"
lgarron 2016/11/29 03:48:49 This is giving me: You added one or more #inc
estark 2016/11/29 21:28:48 I'm guessing ios/chrome is only allowed to depend
Eugene But (OOO till 7-30) 2016/11/30 17:58:41 Yep, ios/chrome can not depend on non-public ios/w
lgarron 2016/12/02 01:21:52 I've added it to the public interface (and removed
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;
52 53
53 namespace { 54 namespace {
54 // Types of password infobars to display. 55 // Types of password infobars to display.
(...skipping 486 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
estark 2016/11/29 21:28:48 nit: unfinished sentence?
lgarron 2016/12/02 01:21:52 Fixed.
554 if (webStateObserverBridge_ && webStateObserverBridge_->web_state()) {
555 // TODO: Only do this for HTTP.
lgarron 2016/11/29 03:48:49 Note: Haven't gotten to this, since it's the "easy
lgarron 2016/12/02 01:21:52 Done.
556 static_cast<web::WebStateImpl*>(webStateObserverBridge_->web_state())
557 ->OnSensitiveInputShownOnHttp();
558 }
559
551 // Invoke the password manager callback to autofill password forms 560 // Invoke the password manager callback to autofill password forms
552 // on the loaded page. 561 // on the loaded page.
553 passwordManager_->OnPasswordFormsParsed(passwordManagerDriver_.get(), 562 passwordManager_->OnPasswordFormsParsed(passwordManagerDriver_.get(),
554 forms); 563 forms);
555 564
556 // Pass the forms to PasswordGenerationAgent to look for account creation 565 // Pass the forms to PasswordGenerationAgent to look for account creation
557 // forms with local heuristics. 566 // forms with local heuristics.
558 [passwordGenerationAgent_ processParsedPasswordForms:forms]; 567 [passwordGenerationAgent_ processParsedPasswordForms:forms];
559 } 568 }
560 // Invoke the password manager callback to check if password was 569 // Invoke the password manager callback to check if password was
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 break; 874 break;
866 875
867 case PasswordInfoBarType::UPDATE: 876 case PasswordInfoBarType::UPDATE:
868 IOSChromeUpdatePasswordInfoBarDelegate::Create( 877 IOSChromeUpdatePasswordInfoBarDelegate::Create(
869 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); 878 isSmartLockBrandingEnabled, infoBarManager, std::move(form));
870 break; 879 break;
871 } 880 }
872 } 881 }
873 882
874 @end 883 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698