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

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

Issue 733953002: Do not save passwords if the landing page has HTTP status 5xx or 4xx (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 "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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 if (service) 283 if (service)
284 service->ProcessLog(text); 284 service->ProcessLog(text);
285 } 285 }
286 286
287 bool ChromePasswordManagerClient::IsLoggingActive() const { 287 bool ChromePasswordManagerClient::IsLoggingActive() const {
288 // WebUI tabs do not need to log password saving progress. In particular, the 288 // WebUI tabs do not need to log password saving progress. In particular, the
289 // internals page itself should not send any logs. 289 // internals page itself should not send any logs.
290 return can_use_log_router_ && !web_contents()->GetWebUI(); 290 return can_use_log_router_ && !web_contents()->GetWebUI();
291 } 291 }
292 292
293 bool ChromePasswordManagerClient::WasLastNavigationHTTPError() const {
294 DCHECK(web_contents());
vabr (Chromium) 2014/11/17 15:32:15 Please create here an instance of BrowserSavePassw
Sunil Ratnu 2014/11/18 06:40:05 Done.
295 content::NavigationEntry* entry =
296 web_contents()->GetController().GetVisibleEntry();
297 if (!entry)
298 return false;
299 int http_status_code = entry->GetHttpStatusCode();
300 if (http_status_code >= 400 && http_status_code <= 600)
vabr (Chromium) 2014/11/17 15:32:15 Please change "<= 600" to "< 600". There does not
Sunil Ratnu 2014/11/18 06:40:05 Done.
301 return true;
302 return false;
303 }
304
293 // static 305 // static
294 password_manager::PasswordGenerationManager* 306 password_manager::PasswordGenerationManager*
295 ChromePasswordManagerClient::GetGenerationManagerFromWebContents( 307 ChromePasswordManagerClient::GetGenerationManagerFromWebContents(
296 content::WebContents* contents) { 308 content::WebContents* contents) {
297 ChromePasswordManagerClient* client = 309 ChromePasswordManagerClient* client =
298 ChromePasswordManagerClient::FromWebContents(contents); 310 ChromePasswordManagerClient::FromWebContents(contents);
299 if (!client) 311 if (!client)
300 return NULL; 312 return NULL;
301 return client->GetDriver()->GetPasswordGenerationManager(); 313 return client->GetDriver()->GetPasswordGenerationManager();
302 } 314 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 501
490 if (group_name == "DisallowSyncCredentialsForReauth") { 502 if (group_name == "DisallowSyncCredentialsForReauth") {
491 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; 503 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH;
492 } else if (group_name == "DisallowSyncCredentials") { 504 } else if (group_name == "DisallowSyncCredentials") {
493 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; 505 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS;
494 } else { 506 } else {
495 // Allow by default. 507 // Allow by default.
496 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; 508 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS;
497 } 509 }
498 } 510 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698