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

Side by Side Diff: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc

Issue 2866443002: [Web Payments] Handle "Enter" accelerator when there's a primary action (Closed)
Patch Set: Add tests to sheets that handle the enter accelerator Created 3 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/payments/shipping_address_editor_view_controll er.h" 5 #include "chrome/browser/ui/views/payments/shipping_address_editor_view_controll er.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 if (model->IsPendingRegionDataLoad()) 365 if (model->IsPendingRegionDataLoad())
366 return; 366 return;
367 if (model->failed_to_load_data()) { 367 if (model->failed_to_load_data()) {
368 failed_to_load_region_data_ = true; 368 failed_to_load_region_data_ = true;
369 // It is safe to update synchronously since the change comes from the model 369 // It is safe to update synchronously since the change comes from the model
370 // and not from the UI. 370 // and not from the UI.
371 OnDataChanged(/*synchronous=*/true); 371 OnDataChanged(/*synchronous=*/true);
372 } 372 }
373 } 373 }
374 374
375 bool ShippingAddressEditorViewController::GetSheetId(DialogViewID* sheet_id) {
376 *sheet_id = DialogViewID::SHIPPING_ADDRESS_EDITOR_SHEET;
377 return true;
378 }
379
375 ShippingAddressEditorViewController::ShippingAddressValidationDelegate:: 380 ShippingAddressEditorViewController::ShippingAddressValidationDelegate::
376 ShippingAddressValidationDelegate( 381 ShippingAddressValidationDelegate(
377 ShippingAddressEditorViewController* controller, 382 ShippingAddressEditorViewController* controller,
378 const EditorField& field) 383 const EditorField& field)
379 : field_(field), controller_(controller) {} 384 : field_(field), controller_(controller) {}
380 385
381 ShippingAddressEditorViewController::ShippingAddressValidationDelegate:: 386 ShippingAddressEditorViewController::ShippingAddressValidationDelegate::
382 ~ShippingAddressValidationDelegate() {} 387 ~ShippingAddressValidationDelegate() {}
383 388
384 bool ShippingAddressEditorViewController::ShippingAddressValidationDelegate:: 389 bool ShippingAddressEditorViewController::ShippingAddressValidationDelegate::
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 bool is_required_valid = !field_.required; 421 bool is_required_valid = !field_.required;
417 const base::string16 displayed_message = 422 const base::string16 displayed_message =
418 is_required_valid ? base::ASCIIToUTF16("") 423 is_required_valid ? base::ASCIIToUTF16("")
419 : l10n_util::GetStringUTF16( 424 : l10n_util::GetStringUTF16(
420 IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE); 425 IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE);
421 controller_->DisplayErrorMessageForField(field_, displayed_message); 426 controller_->DisplayErrorMessageForField(field_, displayed_message);
422 return is_required_valid; 427 return is_required_valid;
423 } 428 }
424 429
425 } // namespace payments 430 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698