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

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

Issue 842503002: Merge to branch 2214 [Password Generation] Hide popup if view can not be created. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2214
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc » ('j') | 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/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 bounds.height()); 175 bounds.height());
176 } 176 }
177 177
178 void PasswordGenerationPopupControllerImpl::Show(bool display_password) { 178 void PasswordGenerationPopupControllerImpl::Show(bool display_password) {
179 display_password_ = display_password; 179 display_password_ = display_password;
180 if (display_password_ && current_password_.empty()) 180 if (display_password_ && current_password_.empty())
181 current_password_ = base::ASCIIToUTF16(generator_->Generate()); 181 current_password_ = base::ASCIIToUTF16(generator_->Generate());
182 182
183 if (!view_) { 183 if (!view_) {
184 view_ = PasswordGenerationPopupView::Create(this); 184 view_ = PasswordGenerationPopupView::Create(this);
185
186 // Treat popup as being hidden if creation fails.
187 if (!view_) {
188 Hide();
189 return;
190 }
191
185 CalculateBounds(); 192 CalculateBounds();
186 view_->Show(); 193 view_->Show();
187 } else { 194 } else {
188 CalculateBounds(); 195 CalculateBounds();
189 view_->UpdateBoundsAndRedrawPopup(); 196 view_->UpdateBoundsAndRedrawPopup();
190 } 197 }
191 198
192 controller_common_.RegisterKeyPressCallback(); 199 controller_common_.RegisterKeyPressCallback();
193 200
194 if (observer_) 201 if (observer_)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 286
280 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { 287 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() {
281 return help_text_; 288 return help_text_;
282 } 289 }
283 290
284 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { 291 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() {
285 return link_range_; 292 return link_range_;
286 } 293 }
287 294
288 } // namespace autofill 295 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698