diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-05 17:34:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-06 10:04:14 +0000 |
commit | eaf1da4d961fbbda9455f9af3b23d1af777f43fa (patch) | |
tree | 95970599ecee31c4f7f940bc97ac98c61a3d0cad /chromium/components/autofill | |
parent | 38a9a29f4f9436cace7f0e7abf9c586057df8a4e (diff) | |
download | qtwebengine-chromium-eaf1da4d961fbbda9455f9af3b23d1af777f43fa.tar.gz |
BASELINE: Update Chromium to 73.0.3683.64
Change-Id: I76517dc277ba4e16bfd7e098fda3d079656b3b9f
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/components/autofill')
5 files changed, 34 insertions, 11 deletions
diff --git a/chromium/components/autofill/core/browser/BUILD.gn b/chromium/components/autofill/core/browser/BUILD.gn index 46afe629e70..9cf6e445d70 100644 --- a/chromium/components/autofill/core/browser/BUILD.gn +++ b/chromium/components/autofill/core/browser/BUILD.gn @@ -335,6 +335,13 @@ jumbo_static_library("browser") { ] } + if (!is_android && !is_ios) { + deps += [ + "//ui/native_theme", + "//ui/native_theme:native_theme_browser", + ] + } + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] } diff --git a/chromium/components/autofill/core/browser/autofill_external_delegate.cc b/chromium/components/autofill/core/browser/autofill_external_delegate.cc index f1f617296f1..2f40e6d1911 100644 --- a/chromium/components/autofill/core/browser/autofill_external_delegate.cc +++ b/chromium/components/autofill/core/browser/autofill_external_delegate.cc @@ -29,6 +29,10 @@ #include "ui/accessibility/platform/ax_platform_node.h" #include "ui/base/l10n/l10n_util.h" +#if !defined(OS_ANDROID) && !defined(OS_IOS) +#include "ui/native_theme/native_theme.h" // nogncheck +#endif + namespace autofill { namespace { @@ -352,8 +356,16 @@ void AutofillExternalDelegate::ApplyAutofillOptions( suggestions->back().frontend_id = POPUP_ITEM_ID_AUTOFILL_OPTIONS; // On Android and Desktop, Google Pay branding is shown along with Settings. // So Google Pay Icon is just attached to an existing menu item. - if (is_all_server_suggestions) + if (is_all_server_suggestions) { +#if defined(OS_ANDROID) || defined(OS_IOS) suggestions->back().icon = base::ASCIIToUTF16("googlePay"); +#else + suggestions->back().icon = base::ASCIIToUTF16( + ui::NativeTheme::GetInstanceForNativeUi()->SystemDarkModeEnabled() + ? "googlePayDark" + : "googlePay"); +#endif + } // On iOS, GooglePayIcon comes at the begining and hence prepended to the list. #if defined(OS_IOS) diff --git a/chromium/components/autofill/ios/browser/autofill_agent_unittests.mm b/chromium/components/autofill/ios/browser/autofill_agent_unittests.mm index e323c47c3e9..72283a3d514 100644 --- a/chromium/components/autofill/ios/browser/autofill_agent_unittests.mm +++ b/chromium/components/autofill/ios/browser/autofill_agent_unittests.mm @@ -713,9 +713,11 @@ TEST_F(AutofillAgentTests, FrameInitializationOrderFrames) { test_web_state_.RemoveWebFrame(fake_main_frame_->GetFrameId()); // Both frames available, then page loaded. + test_web_state_.SetLoading(true); auto main_frame_unique = std::make_unique<web::FakeWebFrame>("main", true, GURL()); web::FakeWebFrame* main_frame = main_frame_unique.get(); + test_web_state_.AddWebFrame(std::move(main_frame_unique)); autofill::AutofillDriverIOS* main_frame_driver = autofill::AutofillDriverIOS::FromWebStateAndWebFrame(&test_web_state_, main_frame); @@ -725,13 +727,11 @@ TEST_F(AutofillAgentTests, FrameInitializationOrderFrames) { EXPECT_TRUE(main_frame_driver->is_processed()); }); FakeWebFrameCallback* iframe = iframe_unique.get(); + test_web_state_.AddWebFrame(std::move(iframe_unique)); autofill::AutofillDriverIOS* iframe_driver = autofill::AutofillDriverIOS::FromWebStateAndWebFrame(&test_web_state_, iframe); EXPECT_FALSE(iframe_driver->IsInMainFrame()); - test_web_state_.SetLoading(true); - test_web_state_.AddWebFrame(std::move(main_frame_unique)); - test_web_state_.AddWebFrame(std::move(iframe_unique)); EXPECT_FALSE(main_frame_driver->is_processed()); EXPECT_FALSE(iframe_driver->is_processed()); test_web_state_.SetLoading(false); diff --git a/chromium/components/autofill/ios/browser/autofill_driver_ios.h b/chromium/components/autofill/ios/browser/autofill_driver_ios.h index 2624127f010..f460f3f12c7 100644 --- a/chromium/components/autofill/ios/browser/autofill_driver_ios.h +++ b/chromium/components/autofill/ios/browser/autofill_driver_ios.h @@ -80,9 +80,9 @@ class AutofillDriverIOS : public AutofillDriver { // The WebState with which this object is associated. web::WebState* web_state_ = nullptr; - // The WebState with which this object is associated. - // nullptr if frame messaging is disabled. - web::WebFrame* web_frame_ = nullptr; + // The id of the WebFrame with which this object is associated. + // "" if frame messaging is disabled. + std::string web_frame_id_; // AutofillDriverIOSBridge instance that is passed in. __unsafe_unretained id<AutofillDriverIOSBridge> bridge_; diff --git a/chromium/components/autofill/ios/browser/autofill_driver_ios.mm b/chromium/components/autofill/ios/browser/autofill_driver_ios.mm index bba0e29ee9a..ce08c746ecd 100644 --- a/chromium/components/autofill/ios/browser/autofill_driver_ios.mm +++ b/chromium/components/autofill/ios/browser/autofill_driver_ios.mm @@ -12,6 +12,7 @@ #include "components/autofill/ios/browser/autofill_switches.h" #include "ios/web/public/browser_state.h" #import "ios/web/public/origin_util.h" +#import "ios/web/public/web_state/web_frame_util.h" #import "ios/web/public/web_state/web_state.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" @@ -63,10 +64,10 @@ AutofillDriverIOS::AutofillDriverIOS( const std::string& app_locale, AutofillManager::AutofillDownloadManagerState enable_download_manager) : web_state_(web_state), - web_frame_(web_frame), bridge_(bridge), autofill_manager_(this, client, app_locale, enable_download_manager), autofill_external_delegate_(&autofill_manager_, this) { + web_frame_id_ = web::GetWebFrameId(web_frame); autofill_manager_.SetExternalDelegate(&autofill_external_delegate_); } @@ -77,7 +78,8 @@ bool AutofillDriverIOS::IsIncognito() const { } bool AutofillDriverIOS::IsInMainFrame() const { - return web_frame_ ? web_frame_->IsMainFrame() : true; + web::WebFrame* web_frame = web::GetWebFrameWithId(web_state_, web_frame_id_); + return web_frame ? web_frame->IsMainFrame() : true; } net::URLRequestContextGetter* AutofillDriverIOS::GetURLRequestContext() { @@ -98,7 +100,8 @@ void AutofillDriverIOS::SendFormDataToRenderer( int query_id, RendererFormDataAction action, const FormData& data) { - [bridge_ fillFormData:data inFrame:web_frame_]; + web::WebFrame* web_frame = web::GetWebFrameWithId(web_state_, web_frame_id_); + [bridge_ fillFormData:data inFrame:web_frame]; } void AutofillDriverIOS::PropagateAutofillPredictions( @@ -108,8 +111,9 @@ void AutofillDriverIOS::PropagateAutofillPredictions( void AutofillDriverIOS::SendAutofillTypePredictionsToRenderer( const std::vector<FormStructure*>& forms) { + web::WebFrame* web_frame = web::GetWebFrameWithId(web_state_, web_frame_id_); [bridge_ fillFormDataPredictions:FormStructure::GetFieldTypePredictions(forms) - inFrame:web_frame_]; + inFrame:web_frame]; } void AutofillDriverIOS::RendererShouldAcceptDataListSuggestion( |