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

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: Squash in little fixes 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 { return logger_; }
Ilya Sherman 2014/04/09 21:10:08 nit: clang-format is being updated to format this
Ilya Sherman 2014/04/09 21:10:08 nit: Please implement this as "return !!logger_",
vabr (Chromium) 2014/04/10 08:51:25 Thanks, that's good to know! Done.
vabr (Chromium) 2014/04/10 08:51:25 I agree, and even the compiler of the win_chromium
187
186 // static 188 // static
187 password_manager::PasswordGenerationManager* 189 password_manager::PasswordGenerationManager*
188 ChromePasswordManagerClient::GetGenerationManagerFromWebContents( 190 ChromePasswordManagerClient::GetGenerationManagerFromWebContents(
189 content::WebContents* contents) { 191 content::WebContents* contents) {
190 ChromePasswordManagerClient* client = 192 ChromePasswordManagerClient* client =
191 ChromePasswordManagerClient::FromWebContents(contents); 193 ChromePasswordManagerClient::FromWebContents(contents);
192 if (!client) 194 if (!client)
193 return NULL; 195 return NULL;
194 return client->GetDriver()->GetPasswordGenerationManager(); 196 return client->GetDriver()->GetPasswordGenerationManager();
195 } 197 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 web_contents(), 276 web_contents(),
275 web_contents()->GetView()->GetNativeView()); 277 web_contents()->GetView()->GetNativeView());
276 popup_controller_->Show(false /* display_password */); 278 popup_controller_->Show(false /* display_password */);
277 #endif // #if defined(USE_AURA) 279 #endif // #if defined(USE_AURA)
278 } 280 }
279 281
280 void ChromePasswordManagerClient::CommitFillPasswordForm( 282 void ChromePasswordManagerClient::CommitFillPasswordForm(
281 autofill::PasswordFormFillData* data) { 283 autofill::PasswordFormFillData* data) {
282 driver_.FillPasswordForm(*data); 284 driver_.FillPasswordForm(*data);
283 } 285 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698