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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp

Issue 2869893002: Warn web developer on missing favicon for PaymentRequest UI. (Closed)
Patch Set: Ganggui's comment 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
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentRequest.h ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/payments/PaymentRequest.h" 5 #include "modules/payments/PaymentRequest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptPromiseResolver.h" 10 #include "bindings/core/v8/ScriptPromiseResolver.h"
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 break; 1049 break;
1050 case CanMakePaymentQueryResult::QUERY_QUOTA_EXCEEDED: 1050 case CanMakePaymentQueryResult::QUERY_QUOTA_EXCEEDED:
1051 can_make_payment_resolver_->Reject(DOMException::Create( 1051 can_make_payment_resolver_->Reject(DOMException::Create(
1052 kNotAllowedError, "Not allowed to check whether can make payment")); 1052 kNotAllowedError, "Not allowed to check whether can make payment"));
1053 break; 1053 break;
1054 } 1054 }
1055 1055
1056 can_make_payment_resolver_.Clear(); 1056 can_make_payment_resolver_.Clear();
1057 } 1057 }
1058 1058
1059 void PaymentRequest::WarnNoFavicon() {
1060 GetExecutionContext()->AddConsoleMessage(
1061 ConsoleMessage::Create(kJSMessageSource, kWarningMessageLevel,
1062 "Favicon not found for PaymentRequest UI. User "
1063 "may not recognize the website."));
1064 }
1065
1059 void PaymentRequest::OnCompleteTimeout(TimerBase*) { 1066 void PaymentRequest::OnCompleteTimeout(TimerBase*) {
1060 GetExecutionContext()->AddConsoleMessage(ConsoleMessage::Create( 1067 GetExecutionContext()->AddConsoleMessage(ConsoleMessage::Create(
1061 kJSMessageSource, kErrorMessageLevel, 1068 kJSMessageSource, kErrorMessageLevel,
1062 "Timed out waiting for a PaymentResponse.complete() call.")); 1069 "Timed out waiting for a PaymentResponse.complete() call."));
1063 payment_provider_->Complete(payments::mojom::blink::PaymentComplete(kFail)); 1070 payment_provider_->Complete(payments::mojom::blink::PaymentComplete(kFail));
1064 ClearResolversAndCloseMojoConnection(); 1071 ClearResolversAndCloseMojoConnection();
1065 } 1072 }
1066 1073
1067 void PaymentRequest::ClearResolversAndCloseMojoConnection() { 1074 void PaymentRequest::ClearResolversAndCloseMojoConnection() {
1068 complete_timer_.Stop(); 1075 complete_timer_.Stop();
1069 complete_resolver_.Clear(); 1076 complete_resolver_.Clear();
1070 show_resolver_.Clear(); 1077 show_resolver_.Clear();
1071 abort_resolver_.Clear(); 1078 abort_resolver_.Clear();
1072 can_make_payment_resolver_.Clear(); 1079 can_make_payment_resolver_.Clear();
1073 if (client_binding_.is_bound()) 1080 if (client_binding_.is_bound())
1074 client_binding_.Close(); 1081 client_binding_.Close();
1075 payment_provider_.reset(); 1082 payment_provider_.reset();
1076 } 1083 }
1077 1084
1078 } // namespace blink 1085 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentRequest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698