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

Side by Side Diff: chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc

Issue 287063007: Revert of [Mac] Unselect generated password when mouse leaves password bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/autofill/password_generation_popup_controller_impl.h " 5 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h "
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 bool PasswordGenerationPopupControllerImpl::PossiblyAcceptPassword() { 130 bool PasswordGenerationPopupControllerImpl::PossiblyAcceptPassword() {
131 if (password_selected_) { 131 if (password_selected_) {
132 PasswordAccepted(); // This will delete |this|. 132 PasswordAccepted(); // This will delete |this|.
133 return true; 133 return true;
134 } 134 }
135 135
136 return false; 136 return false;
137 } 137 }
138 138
139 void PasswordGenerationPopupControllerImpl::PasswordSelected(bool selected) { 139 void PasswordGenerationPopupControllerImpl::PasswordSelected(bool selected) {
140 if (!display_password_ || selected == password_selected_) 140 if (!display_password_)
141 return; 141 return;
142 142
143 password_selected_ = selected; 143 password_selected_ = selected;
144 view_->PasswordSelectionUpdated(); 144 view_->PasswordSelectionUpdated();
145 view_->UpdateBoundsAndRedrawPopup(); 145 view_->UpdateBoundsAndRedrawPopup();
146 } 146 }
147 147
148 void PasswordGenerationPopupControllerImpl::PasswordAccepted() { 148 void PasswordGenerationPopupControllerImpl::PasswordAccepted() {
149 if (!display_password_) 149 if (!display_password_)
150 return; 150 return;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 Browser* browser = 282 Browser* browser =
283 chrome::FindBrowserWithWebContents(controller_common_.web_contents()); 283 chrome::FindBrowserWithWebContents(controller_common_.web_contents());
284 content::OpenURLParams params( 284 content::OpenURLParams params(
285 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(), 285 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(),
286 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false); 286 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false);
287 browser->OpenURL(params); 287 browser->OpenURL(params);
288 } 288 }
289 289
290 void PasswordGenerationPopupControllerImpl::SetSelectionAtPoint( 290 void PasswordGenerationPopupControllerImpl::SetSelectionAtPoint(
291 const gfx::Point& point) { 291 const gfx::Point& point) {
292 PasswordSelected(password_bounds_.Contains(point)); 292 if (password_bounds_.Contains(point))
293 PasswordSelected(true);
293 } 294 }
294 295
295 bool PasswordGenerationPopupControllerImpl::AcceptSelectedLine() { 296 bool PasswordGenerationPopupControllerImpl::AcceptSelectedLine() {
296 if (!password_selected_) 297 if (!password_selected_)
297 return false; 298 return false;
298 299
299 PasswordAccepted(); 300 PasswordAccepted();
300 return true; 301 return true;
301 } 302 }
302 303
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 349
349 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { 350 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() {
350 return help_text_; 351 return help_text_;
351 } 352 }
352 353
353 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { 354 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() {
354 return link_range_; 355 return link_range_;
355 } 356 }
356 357
357 } // namespace autofill 358 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698