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

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

Issue 228263004: Password manager internals page: Introduce logger in renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 6 years, 8 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 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 "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // will leave the first without further updates, and the user likely confused. 172 // will leave the first without further updates, and the user likely confused.
173 // TODO(vabr): For the reason above, before moving the internals page from 173 // TODO(vabr): For the reason above, before moving the internals page from
174 // behind the flag, make sure to restrict the number of internals page 174 // behind the flag, make sure to restrict the number of internals page
175 // instances to 1 in normal profiles, and 0 in incognito. 175 // instances to 1 in normal profiles, and 0 in incognito.
176 DCHECK(!logger || !logger_); 176 DCHECK(!logger || !logger_);
177 logger_ = logger; 177 logger_ = logger;
178 } 178 }
179 179
180 void ChromePasswordManagerClient::LogSavePasswordProgress( 180 void ChromePasswordManagerClient::LogSavePasswordProgress(
181 const std::string& text) { 181 const std::string& text) {
182 if (logger_) 182 if (IsLoggingActive())
183 logger_->LogSavePasswordProgress(text); 183 logger_->LogSavePasswordProgress(text);
184 } 184 }
185 185
186 bool ChromePasswordManagerClient::IsLoggingActive() const {
187 return logger_ != NULL;
188 }
189
186 // static 190 // static
187 password_manager::PasswordGenerationManager* 191 password_manager::PasswordGenerationManager*
188 ChromePasswordManagerClient::GetGenerationManagerFromWebContents( 192 ChromePasswordManagerClient::GetGenerationManagerFromWebContents(
189 content::WebContents* contents) { 193 content::WebContents* contents) {
190 ChromePasswordManagerClient* client = 194 ChromePasswordManagerClient* client =
191 ChromePasswordManagerClient::FromWebContents(contents); 195 ChromePasswordManagerClient::FromWebContents(contents);
192 if (!client) 196 if (!client)
193 return NULL; 197 return NULL;
194 return client->GetDriver()->GetPasswordGenerationManager(); 198 return client->GetDriver()->GetPasswordGenerationManager();
195 } 199 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 web_contents(), 278 web_contents(),
275 web_contents()->GetView()->GetNativeView()); 279 web_contents()->GetView()->GetNativeView());
276 popup_controller_->Show(false /* display_password */); 280 popup_controller_->Show(false /* display_password */);
277 #endif // #if defined(USE_AURA) 281 #endif // #if defined(USE_AURA)
278 } 282 }
279 283
280 void ChromePasswordManagerClient::CommitFillPasswordForm( 284 void ChromePasswordManagerClient::CommitFillPasswordForm(
281 autofill::PasswordFormFillData* data) { 285 autofill::PasswordFormFillData* data) {
282 driver_.FillPasswordForm(*data); 286 driver_.FillPasswordForm(*data);
283 } 287 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698