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

Unified Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc

Issue 2432483002: Do not try to pop up the account chooser if there is no browser window. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
index f73ebcde8f0aefd5640aafa772879fa5e0393feb..beb3495ebe9156e24fe8c5212d1a5c316036d23e 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -100,6 +100,8 @@ bool ManagePasswordsUIController::OnChooseCredentials(
const GURL& origin,
const ManagePasswordsState::CredentialsCallback& callback) {
DCHECK(!local_credentials.empty() || !federated_credentials.empty());
+ if (!HasBrowserWindow())
+ return false;
PasswordDialogController::FormsVector locals =
CopyFormVector(local_credentials);
PasswordDialogController::FormsVector federations =
@@ -413,6 +415,10 @@ AutoSigninFirstRunPrompt* ManagePasswordsUIController::CreateAutoSigninPrompt(
return CreateAutoSigninPromptView(controller, web_contents());
}
+bool ManagePasswordsUIController::HasBrowserWindow() const {
+ return chrome::FindBrowserWithWebContents(web_contents()) != nullptr;
+}
+
void ManagePasswordsUIController::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {

Powered by Google App Engine
This is Rietveld 408576698