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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/password_manager/password_store_factory.h" | 9 #include "chrome/browser/password_manager/password_store_factory.h" |
10 #include "chrome/browser/ui/browser_command_controller.h" | 10 #include "chrome/browser/ui/browser_command_controller.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 void ManagePasswordsUIController::OnBlacklistBlockedAutofill( | 76 void ManagePasswordsUIController::OnBlacklistBlockedAutofill( |
77 const PasswordFormMap& password_form_map) { | 77 const PasswordFormMap& password_form_map) { |
78 password_form_map_ = password_form_map; | 78 password_form_map_ = password_form_map; |
79 origin_ = password_form_map_.begin()->second->origin; | 79 origin_ = password_form_map_.begin()->second->origin; |
80 state_ = password_manager::ui::BLACKLIST_STATE; | 80 state_ = password_manager::ui::BLACKLIST_STATE; |
81 UpdateBubbleAndIconVisibility(); | 81 UpdateBubbleAndIconVisibility(); |
82 } | 82 } |
83 | 83 |
84 void ManagePasswordsUIController::WebContentsDestroyed( | 84 void ManagePasswordsUIController::WebContentsDestroyed() { |
85 content::WebContents* web_contents) { | |
86 password_manager::PasswordStore* password_store = | 85 password_manager::PasswordStore* password_store = |
87 GetPasswordStore(web_contents); | 86 GetPasswordStore(web_contents()); |
88 if (password_store) | 87 if (password_store) |
89 password_store->RemoveObserver(this); | 88 password_store->RemoveObserver(this); |
90 } | 89 } |
91 | 90 |
92 void ManagePasswordsUIController::OnLoginsChanged( | 91 void ManagePasswordsUIController::OnLoginsChanged( |
93 const password_manager::PasswordStoreChangeList& changes) { | 92 const password_manager::PasswordStoreChangeList& changes) { |
94 for (password_manager::PasswordStoreChangeList::const_iterator it = | 93 for (password_manager::PasswordStoreChangeList::const_iterator it = |
95 changes.begin(); | 94 changes.begin(); |
96 it != changes.end(); | 95 it != changes.end(); |
97 it++) { | 96 it++) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 return; | 192 return; |
194 CommandUpdater* updater = browser->command_controller()->command_updater(); | 193 CommandUpdater* updater = browser->command_controller()->command_updater(); |
195 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 194 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
196 #endif | 195 #endif |
197 } | 196 } |
198 | 197 |
199 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { | 198 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { |
200 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || | 199 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || |
201 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; | 200 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; |
202 } | 201 } |
OLD | NEW |