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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller.cc

Issue 338103003: Password bubble: Ensure that the bubble stays open for at least 1 second. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed base. Created 6 years, 6 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 | Annotate | Revision Log
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/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/browsing_data/browsing_data_helper.h" 8 #include "chrome/browser/browsing_data/browsing_data_helper.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/password_manager/password_store_factory.h" 10 #include "chrome/browser/password_manager/password_store_factory.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 GetPasswordStore(web_contents()); 164 GetPasswordStore(web_contents());
165 if (password_store) 165 if (password_store)
166 password_store->RemoveLogin(*password_form_map_.begin()->second); 166 password_store->RemoveLogin(*password_form_map_.begin()->second);
167 state_ = password_manager::ui::MANAGE_STATE; 167 state_ = password_manager::ui::MANAGE_STATE;
168 UpdateBubbleAndIconVisibility(); 168 UpdateBubbleAndIconVisibility();
169 } 169 }
170 170
171 void ManagePasswordsUIController::DidNavigateMainFrame( 171 void ManagePasswordsUIController::DidNavigateMainFrame(
172 const content::LoadCommittedDetails& details, 172 const content::LoadCommittedDetails& details,
173 const content::FrameNavigateParams& params) { 173 const content::FrameNavigateParams& params) {
174 // Don't react to in-page (fragment) navigations.
174 if (details.is_in_page) 175 if (details.is_in_page)
175 return; 176 return;
177
178 // Don't do anything if a navigation occurs before a user could reasonably
179 // interact with the password bubble.
180 if (timer_ && timer_->Elapsed() < base::TimeDelta::FromSeconds(1))
181 return;
182
183 // Otherwise, reset the password manager and the timer.
176 state_ = password_manager::ui::INACTIVE_STATE; 184 state_ = password_manager::ui::INACTIVE_STATE;
177 UpdateBubbleAndIconVisibility(); 185 UpdateBubbleAndIconVisibility();
186 timer_.reset(new base::ElapsedTimer());
178 } 187 }
179 188
180 const autofill::PasswordForm& ManagePasswordsUIController:: 189 const autofill::PasswordForm& ManagePasswordsUIController::
181 PendingCredentials() const { 190 PendingCredentials() const {
182 DCHECK(form_manager_); 191 DCHECK(form_manager_);
183 return form_manager_->pending_credentials(); 192 return form_manager_->pending_credentials();
184 } 193 }
185 194
186 void ManagePasswordsUIController::UpdateIconAndBubbleState( 195 void ManagePasswordsUIController::UpdateIconAndBubbleState(
187 ManagePasswordsIcon* icon) { 196 ManagePasswordsIcon* icon) {
(...skipping 20 matching lines...) Expand all
208 return; 217 return;
209 CommandUpdater* updater = browser->command_controller()->command_updater(); 218 CommandUpdater* updater = browser->command_controller()->command_updater();
210 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); 219 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE);
211 #endif 220 #endif
212 } 221 }
213 222
214 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { 223 bool ManagePasswordsUIController::PasswordPendingUserDecision() const {
215 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || 224 return state_ == password_manager::ui::PENDING_PASSWORD_STATE ||
216 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; 225 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE;
217 } 226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698