| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_bubble_ui_controller.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/password_manager/password_store_factory.h" | 8 #include "chrome/browser/password_manager/password_store_factory.h" |
| 9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 void ManagePasswordsBubbleUIController::OnBlacklistBlockedAutofill() { | 83 void ManagePasswordsBubbleUIController::OnBlacklistBlockedAutofill() { |
| 84 manage_passwords_icon_to_be_shown_ = true; | 84 manage_passwords_icon_to_be_shown_ = true; |
| 85 password_to_be_saved_ = false; | 85 password_to_be_saved_ = false; |
| 86 manage_passwords_bubble_needs_showing_ = false; | 86 manage_passwords_bubble_needs_showing_ = false; |
| 87 autofill_blocked_ = true; | 87 autofill_blocked_ = true; |
| 88 UpdateBubbleAndIconVisibility(); | 88 UpdateBubbleAndIconVisibility(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void ManagePasswordsBubbleUIController::WebContentsDestroyed( | 91 void ManagePasswordsBubbleUIController::WebContentsDestroyed() { |
| 92 content::WebContents* web_contents) { | |
| 93 password_manager::PasswordStore* password_store = | 92 password_manager::PasswordStore* password_store = |
| 94 GetPasswordStore(web_contents); | 93 GetPasswordStore(web_contents()); |
| 95 if (password_store) | 94 if (password_store) |
| 96 password_store->RemoveObserver(this); | 95 password_store->RemoveObserver(this); |
| 97 } | 96 } |
| 98 | 97 |
| 99 void ManagePasswordsBubbleUIController::OnLoginsChanged( | 98 void ManagePasswordsBubbleUIController::OnLoginsChanged( |
| 100 const password_manager::PasswordStoreChangeList& changes) { | 99 const password_manager::PasswordStoreChangeList& changes) { |
| 101 for (password_manager::PasswordStoreChangeList::const_iterator it = | 100 for (password_manager::PasswordStoreChangeList::const_iterator it = |
| 102 changes.begin(); | 101 changes.begin(); |
| 103 it != changes.end(); | 102 it != changes.end(); |
| 104 it++) { | 103 it++) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 state = ManagePasswordsIcon::MANAGE_STATE; | 166 state = ManagePasswordsIcon::MANAGE_STATE; |
| 168 | 167 |
| 169 icon->SetState(state); | 168 icon->SetState(state); |
| 170 | 169 |
| 171 if (manage_passwords_bubble_needs_showing_) { | 170 if (manage_passwords_bubble_needs_showing_) { |
| 172 DCHECK(state == ManagePasswordsIcon::PENDING_STATE); | 171 DCHECK(state == ManagePasswordsIcon::PENDING_STATE); |
| 173 icon->ShowBubbleWithoutUserInteraction(); | 172 icon->ShowBubbleWithoutUserInteraction(); |
| 174 manage_passwords_bubble_needs_showing_ = false; | 173 manage_passwords_bubble_needs_showing_ = false; |
| 175 } | 174 } |
| 176 } | 175 } |
| OLD | NEW |