Commit 0f5a9a1f authored by Kevin McNee's avatar Kevin McNee Committed by Commit Bot

ContactsManager: Remove check for native window when selecting UKM source id

The need to access the WebContents when selecting the UKM source id for
ContactsManagerImpl appears to be from before the introduction of
RenderFrameHostImpl::GetPageUkmSourceId. The WebContents is now only
used to check whether there is a native window. This logic seems
unrelated to UKM source id selection, since there is already code that
checks for the existence of the native window to show a dialog in
ContactsProviderAndroid.

Noticed while auditing uses of WebContents::FromRenderFrameHost.

Bug: None
Change-Id: I68f652ad3c3cb2c40571bde59c7ea3e50618f7b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422484Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809824}
parent c38def19
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/contacts_picker_properties_requested.h" #include "content/public/browser/contacts_picker_properties_requested.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "services/metrics/public/cpp/metrics_utils.h" #include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h" #include "services/metrics/public/cpp/ukm_builders.h"
...@@ -65,14 +64,8 @@ void ContactsManagerImpl::Create( ...@@ -65,14 +64,8 @@ void ContactsManagerImpl::Create(
} }
ContactsManagerImpl::ContactsManagerImpl(RenderFrameHostImpl* render_frame_host) ContactsManagerImpl::ContactsManagerImpl(RenderFrameHostImpl* render_frame_host)
: contacts_provider_(CreateProvider(render_frame_host)) { : contacts_provider_(CreateProvider(render_frame_host)),
WebContents* web_contents = source_id_(render_frame_host->GetPageUkmSourceId()) {}
WebContents::FromRenderFrameHost(render_frame_host);
if (!web_contents || !web_contents->GetTopLevelNativeWindow())
return;
source_id_ = render_frame_host->GetPageUkmSourceId();
}
ContactsManagerImpl::~ContactsManagerImpl() = default; ContactsManagerImpl::~ContactsManagerImpl() = default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment