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

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

Issue 2606473003: Use AutofillDriver* in ContentAutofillDriverFactory when possible (Closed)
Patch Set: Fix Android compilation Created 3 years, 12 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"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 const password_manager::PasswordManager* 447 const password_manager::PasswordManager*
448 ChromePasswordManagerClient::GetPasswordManager() const { 448 ChromePasswordManagerClient::GetPasswordManager() const {
449 return &password_manager_; 449 return &password_manager_;
450 } 450 }
451 451
452 autofill::AutofillManager* 452 autofill::AutofillManager*
453 ChromePasswordManagerClient::GetAutofillManagerForMainFrame() { 453 ChromePasswordManagerClient::GetAutofillManagerForMainFrame() {
454 autofill::ContentAutofillDriverFactory* factory = 454 autofill::ContentAutofillDriverFactory* factory =
455 autofill::ContentAutofillDriverFactory::FromWebContents(web_contents()); 455 autofill::ContentAutofillDriverFactory::FromWebContents(web_contents());
456 return factory 456 return factory
457 ? factory->DriverForFrame(web_contents()->GetMainFrame()) 457 ? static_cast<autofill::ContentAutofillDriver*>(
458 factory->DriverForFrame(web_contents()->GetMainFrame()))
458 ->autofill_manager() 459 ->autofill_manager()
459 : nullptr; 460 : nullptr;
460 } 461 }
461 462
462 void ChromePasswordManagerClient::SetTestObserver( 463 void ChromePasswordManagerClient::SetTestObserver(
463 autofill::PasswordGenerationPopupObserver* observer) { 464 autofill::PasswordGenerationPopupObserver* observer) {
464 observer_ = observer; 465 observer_ = observer;
465 } 466 }
466 467
467 void ChromePasswordManagerClient::DidStartNavigation( 468 void ChromePasswordManagerClient::DidStartNavigation(
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 ChromePasswordManagerClient::FromWebContents(web_contents); 614 ChromePasswordManagerClient::FromWebContents(web_contents);
614 615
615 // Try to bind to the driver, but if driver is not available for this render 616 // Try to bind to the driver, but if driver is not available for this render
616 // frame host, the request will be just dropped. This will cause the message 617 // frame host, the request will be just dropped. This will cause the message
617 // pipe to be closed, which will raise a connection error on the peer side. 618 // pipe to be closed, which will raise a connection error on the peer side.
618 if (!instance) 619 if (!instance)
619 return; 620 return;
620 621
621 instance->credential_manager_impl_.BindRequest(std::move(request)); 622 instance->credential_manager_impl_.BindRequest(std::move(request));
622 } 623 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698