OLD | NEW |
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/ui/passwords/manage_passwords_ui_controller.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 414 } |
415 | 415 |
416 bool ManagePasswordsUIController::HasBrowserWindow() const { | 416 bool ManagePasswordsUIController::HasBrowserWindow() const { |
417 return chrome::FindBrowserWithWebContents(web_contents()) != nullptr; | 417 return chrome::FindBrowserWithWebContents(web_contents()) != nullptr; |
418 } | 418 } |
419 | 419 |
420 void ManagePasswordsUIController::DidFinishNavigation( | 420 void ManagePasswordsUIController::DidFinishNavigation( |
421 content::NavigationHandle* navigation_handle) { | 421 content::NavigationHandle* navigation_handle) { |
422 if (!navigation_handle->IsInMainFrame() || | 422 if (!navigation_handle->IsInMainFrame() || |
423 !navigation_handle->HasCommitted() || | 423 !navigation_handle->HasCommitted() || |
424 // Don't react to in-page (fragment) navigations. | 424 // Don't react to same-document (fragment) navigations. |
425 navigation_handle->IsSamePage()) { | 425 navigation_handle->IsSameDocument()) { |
426 return; | 426 return; |
427 } | 427 } |
428 | 428 |
429 // It is possible that the user was not able to interact with the password | 429 // It is possible that the user was not able to interact with the password |
430 // bubble. | 430 // bubble. |
431 if (bubble_status_ == SHOWN || bubble_status_ == SHOWN_PENDING_ICON_UPDATE) | 431 if (bubble_status_ == SHOWN || bubble_status_ == SHOWN_PENDING_ICON_UPDATE) |
432 return; | 432 return; |
433 | 433 |
434 // Otherwise, reset the password manager. | 434 // Otherwise, reset the password manager. |
435 DestroyAccountChooser(); | 435 DestroyAccountChooser(); |
(...skipping 21 matching lines...) Expand all Loading... |
457 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); | 457 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); |
458 } | 458 } |
459 } | 459 } |
460 | 460 |
461 void ManagePasswordsUIController::WebContentsDestroyed() { | 461 void ManagePasswordsUIController::WebContentsDestroyed() { |
462 password_manager::PasswordStore* password_store = | 462 password_manager::PasswordStore* password_store = |
463 GetPasswordStore(web_contents()); | 463 GetPasswordStore(web_contents()); |
464 if (password_store) | 464 if (password_store) |
465 password_store->RemoveObserver(this); | 465 password_store->RemoveObserver(this); |
466 } | 466 } |
OLD | NEW |