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

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 2667983006: Add HTTP-specific metrics for password forms (Closed)
Patch Set: fix another histogram, add a comment Created 3 years, 10 months 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 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/password_manager/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "components/prefs/pref_service.h" 49 #include "components/prefs/pref_service.h"
50 #include "components/sessions/content/content_record_password_state.h" 50 #include "components/sessions/content/content_record_password_state.h"
51 #include "components/signin/core/browser/signin_manager.h" 51 #include "components/signin/core/browser/signin_manager.h"
52 #include "components/version_info/version_info.h" 52 #include "components/version_info/version_info.h"
53 #include "content/public/browser/child_process_security_policy.h" 53 #include "content/public/browser/child_process_security_policy.h"
54 #include "content/public/browser/navigation_entry.h" 54 #include "content/public/browser/navigation_entry.h"
55 #include "content/public/browser/navigation_handle.h" 55 #include "content/public/browser/navigation_handle.h"
56 #include "content/public/browser/render_view_host.h" 56 #include "content/public/browser/render_view_host.h"
57 #include "content/public/browser/ssl_status.h" 57 #include "content/public/browser/ssl_status.h"
58 #include "content/public/browser/web_contents.h" 58 #include "content/public/browser/web_contents.h"
59 #include "content/public/common/origin_util.h"
59 #include "extensions/features/features.h" 60 #include "extensions/features/features.h"
60 #include "google_apis/gaia/gaia_urls.h" 61 #include "google_apis/gaia/gaia_urls.h"
61 #include "net/base/url_util.h" 62 #include "net/base/url_util.h"
62 #include "third_party/re2/src/re2/re2.h" 63 #include "third_party/re2/src/re2/re2.h"
63 64
64 #if defined(OS_ANDROID) 65 #if defined(OS_ANDROID)
65 #include "chrome/browser/android/tab_android.h" 66 #include "chrome/browser/android/tab_android.h"
66 #include "chrome/browser/password_manager/account_chooser_dialog_android.h" 67 #include "chrome/browser/password_manager/account_chooser_dialog_android.h"
67 #include "chrome/browser/password_manager/auto_signin_first_run_dialog_android.h " 68 #include "chrome/browser/password_manager/auto_signin_first_run_dialog_android.h "
68 #include "chrome/browser/password_manager/generated_password_saved_infobar_deleg ate_android.h" 69 #include "chrome/browser/password_manager/generated_password_saved_infobar_deleg ate_android.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 564
564 void ChromePasswordManagerClient::GenerationAvailableForForm( 565 void ChromePasswordManagerClient::GenerationAvailableForForm(
565 const autofill::PasswordForm& form) { 566 const autofill::PasswordForm& form) {
566 password_manager_.GenerationAvailableForForm(form); 567 password_manager_.GenerationAvailableForForm(form);
567 } 568 }
568 569
569 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { 570 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const {
570 return web_contents()->GetVisibleURL(); 571 return web_contents()->GetVisibleURL();
571 } 572 }
572 573
574 bool ChromePasswordManagerClient::IsMainFrameSecure() const {
575 return content::IsOriginSecure(web_contents()->GetVisibleURL());
576 }
577
573 const GURL& ChromePasswordManagerClient::GetLastCommittedEntryURL() const { 578 const GURL& ChromePasswordManagerClient::GetLastCommittedEntryURL() const {
574 DCHECK(web_contents()); 579 DCHECK(web_contents());
575 content::NavigationEntry* entry = 580 content::NavigationEntry* entry =
576 web_contents()->GetController().GetLastCommittedEntry(); 581 web_contents()->GetController().GetLastCommittedEntry();
577 if (!entry) 582 if (!entry)
578 return GURL::EmptyGURL(); 583 return GURL::EmptyGURL();
579 584
580 return entry->GetURL(); 585 return entry->GetURL();
581 } 586 }
582 587
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 // static 658 // static
654 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { 659 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) {
655 std::string scheme = url.scheme(); 660 std::string scheme = url.scheme();
656 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( 661 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme(
657 scheme) && 662 scheme) &&
658 #if BUILDFLAG(ENABLE_EXTENSIONS) 663 #if BUILDFLAG(ENABLE_EXTENSIONS)
659 scheme != extensions::kExtensionScheme && 664 scheme != extensions::kExtensionScheme &&
660 #endif 665 #endif
661 scheme != content::kChromeDevToolsScheme); 666 scheme != content::kChromeDevToolsScheme);
662 } 667 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698