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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 663643002: requestAutocomplete (desktop): don't get stuck in infinite loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/autofill/autofill_dialog_views.h" 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 base::string16 AutofillDialogViews::GetCvc() { 1396 base::string16 AutofillDialogViews::GetCvc() {
1397 return GroupForSection(GetCreditCardSection())->suggested_info-> 1397 return GroupForSection(GetCreditCardSection())->suggested_info->
1398 textfield()->GetText(); 1398 textfield()->GetText();
1399 } 1399 }
1400 1400
1401 bool AutofillDialogViews::SaveDetailsLocally() { 1401 bool AutofillDialogViews::SaveDetailsLocally() {
1402 DCHECK(save_in_chrome_checkbox_->visible()); 1402 DCHECK(save_in_chrome_checkbox_->visible());
1403 return save_in_chrome_checkbox_->checked(); 1403 return save_in_chrome_checkbox_->checked();
1404 } 1404 }
1405 1405
1406 const content::NavigationController* AutofillDialogViews::ShowSignIn() { 1406 const content::NavigationController* AutofillDialogViews::ShowSignIn(
1407 const GURL& url) {
1407 // The initial minimum width and height are set such that the dialog 1408 // The initial minimum width and height are set such that the dialog
1408 // won't change size before the page is loaded. 1409 // won't change size before the page is loaded.
1409 int min_width = GetContentsBounds().width(); 1410 int min_width = GetContentsBounds().width();
1410 // The height has to include the button strip. 1411 // The height has to include the button strip.
1411 int min_height = GetDialogClientView()->GetContentsBounds().height(); 1412 int min_height = GetDialogClientView()->GetContentsBounds().height();
1412 1413
1413 // TODO(abodenha): We should be able to use the WebContents of the WebView 1414 // TODO(abodenha): We should be able to use the WebContents of the WebView
1414 // to navigate instead of LoadInitialURL. Figure out why it doesn't work. 1415 // to navigate instead of LoadInitialURL. Figure out why it doesn't work.
1415 sign_in_delegate_.reset( 1416 sign_in_delegate_.reset(
1416 new AutofillDialogSignInDelegate( 1417 new AutofillDialogSignInDelegate(
1417 this, 1418 this,
1418 sign_in_web_view_->GetWebContents(), 1419 sign_in_web_view_->GetWebContents(),
1419 delegate_->GetWebContents(), 1420 delegate_->GetWebContents(),
1420 gfx::Size(min_width, min_height), GetMaximumSignInViewSize())); 1421 gfx::Size(min_width, min_height), GetMaximumSignInViewSize()));
1421 sign_in_web_view_->LoadInitialURL(delegate_->SignInUrl()); 1422 sign_in_web_view_->LoadInitialURL(url);
1422 1423
1423 ShowDialogInMode(SIGN_IN); 1424 ShowDialogInMode(SIGN_IN);
1424 1425
1425 ContentsPreferredSizeChanged(); 1426 ContentsPreferredSizeChanged();
1426 1427
1427 return &sign_in_web_view_->web_contents()->GetController(); 1428 return &sign_in_web_view_->web_contents()->GetController();
1428 } 1429 }
1429 1430
1430 void AutofillDialogViews::HideSignIn() { 1431 void AutofillDialogViews::HideSignIn() {
1431 sign_in_web_view_->SetWebContents(NULL); 1432 sign_in_web_view_->SetWebContents(NULL);
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
2503 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2504 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2504 : section(section), 2505 : section(section),
2505 container(NULL), 2506 container(NULL),
2506 manual_input(NULL), 2507 manual_input(NULL),
2507 suggested_info(NULL), 2508 suggested_info(NULL),
2508 suggested_button(NULL) {} 2509 suggested_button(NULL) {}
2509 2510
2510 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2511 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2511 2512
2512 } // namespace autofill 2513 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698