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

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

Issue 2842833003: Update SupportsUserData uses with unique_ptr. (Closed)
Patch Set: rebase Created 3 years, 7 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"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/memory/ptr_util.h"
13 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
14 #include "base/memory/singleton.h" 15 #include "base/memory/singleton.h"
15 #include "base/metrics/field_trial.h" 16 #include "base/metrics/field_trial.h"
16 #include "base/metrics/histogram_macros.h" 17 #include "base/metrics/histogram_macros.h"
17 #include "build/build_config.h" 18 #include "build/build_config.h"
18 #include "chrome/browser/browsing_data/browsing_data_helper.h" 19 #include "chrome/browser/browsing_data/browsing_data_helper.h"
19 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" 20 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
20 #include "chrome/browser/password_manager/password_store_factory.h" 21 #include "chrome/browser/password_manager/password_store_factory.h"
21 #include "chrome/browser/prerender/prerender_contents.h" 22 #include "chrome/browser/prerender/prerender_contents.h"
22 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 143
143 } // namespace 144 } // namespace
144 145
145 // static 146 // static
146 void ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( 147 void ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient(
147 content::WebContents* contents, 148 content::WebContents* contents,
148 autofill::AutofillClient* autofill_client) { 149 autofill::AutofillClient* autofill_client) {
149 if (FromWebContents(contents)) 150 if (FromWebContents(contents))
150 return; 151 return;
151 152
152 contents->SetUserData( 153 contents->SetUserData(UserDataKey(),
153 UserDataKey(), 154 base::WrapUnique(new ChromePasswordManagerClient(
154 new ChromePasswordManagerClient(contents, autofill_client)); 155 contents, autofill_client)));
155 } 156 }
156 157
157 ChromePasswordManagerClient::ChromePasswordManagerClient( 158 ChromePasswordManagerClient::ChromePasswordManagerClient(
158 content::WebContents* web_contents, 159 content::WebContents* web_contents,
159 autofill::AutofillClient* autofill_client) 160 autofill::AutofillClient* autofill_client)
160 : content::WebContentsObserver(web_contents), 161 : content::WebContentsObserver(web_contents),
161 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), 162 profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())),
162 password_manager_(this), 163 password_manager_(this),
163 // TODO(crbug.com/706392): Fix password reuse detection for Android. 164 // TODO(crbug.com/706392): Fix password reuse detection for Android.
164 #if !defined(OS_ANDROID) 165 #if !defined(OS_ANDROID)
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 // static 691 // static
691 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { 692 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) {
692 std::string scheme = url.scheme(); 693 std::string scheme = url.scheme();
693 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( 694 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme(
694 scheme) && 695 scheme) &&
695 #if BUILDFLAG(ENABLE_EXTENSIONS) 696 #if BUILDFLAG(ENABLE_EXTENSIONS)
696 scheme != extensions::kExtensionScheme && 697 scheme != extensions::kExtensionScheme &&
697 #endif 698 #endif
698 scheme != content::kChromeDevToolsScheme); 699 scheme != content::kChromeDevToolsScheme);
699 } 700 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698