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

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

Issue 11085055: Make the WebContentsUserData locator key private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, catch more uses of the key Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/browser/password_manager/password_manager.h" 5 #include "chrome/browser/password_manager/password_manager.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 // static 69 // static
70 void PasswordManager::CreateForWebContentsAndDelegate( 70 void PasswordManager::CreateForWebContentsAndDelegate(
71 content::WebContents* contents, 71 content::WebContents* contents,
72 PasswordManagerDelegate* delegate) { 72 PasswordManagerDelegate* delegate) {
73 if (FromWebContents(contents)) { 73 if (FromWebContents(contents)) {
74 DCHECK_EQ(delegate, FromWebContents(contents)->delegate_); 74 DCHECK_EQ(delegate, FromWebContents(contents)->delegate_);
75 return; 75 return;
76 } 76 }
77 77
78 contents->SetUserData(&kLocatorKey, 78 contents->SetUserData(UserDataKey(),
79 new PasswordManager(contents, delegate)); 79 new PasswordManager(contents, delegate));
80 } 80 }
81 81
82 PasswordManager::PasswordManager(WebContents* web_contents, 82 PasswordManager::PasswordManager(WebContents* web_contents,
83 PasswordManagerDelegate* delegate) 83 PasswordManagerDelegate* delegate)
84 : content::WebContentsObserver(web_contents), 84 : content::WebContentsObserver(web_contents),
85 delegate_(delegate), 85 delegate_(delegate),
86 observer_(NULL) { 86 observer_(NULL) {
87 DCHECK(delegate_); 87 DCHECK(delegate_);
88 password_manager_enabled_.Init(prefs::kPasswordManagerEnabled, 88 password_manager_enabled_.Init(prefs::kPasswordManagerEnabled,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 if (observer_) { 313 if (observer_) {
314 observer_->OnAutofillDataAvailable(preferred_match.username_value, 314 observer_->OnAutofillDataAvailable(preferred_match.username_value,
315 preferred_match.password_value); 315 preferred_match.password_value);
316 } 316 }
317 } 317 }
318 } 318 }
319 319
320 bool PasswordManager::IsFillingEnabled() const { 320 bool PasswordManager::IsFillingEnabled() const {
321 return delegate_->GetProfile() && *password_manager_enabled_; 321 return delegate_->GetProfile() && *password_manager_enabled_;
322 } 322 }
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobar_tab_helper.cc ('k') | chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698