#include "chrome/browser/ui/search/search_ipc_router.h"
#include <utility>
#include "base/memory/raw_ptr.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/instant_service.h"
#include "chrome/browser/search/instant_service_factory.h"
#include "chrome/browser/search/search.h"
#include "components/search/search.h"
#include "content/public/browser/child_process_host.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_frame_host_receiver_set.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
namespace {
bool IsInInstantProcess(content::RenderFrameHost* render_frame) { … }
}
class EmbeddedSearchClientFactoryImpl
: public SearchIPCRouter::EmbeddedSearchClientFactory,
public search::mojom::EmbeddedSearchConnector { … };
void EmbeddedSearchClientFactoryImpl::Connect(
mojo::PendingAssociatedReceiver<search::mojom::EmbeddedSearch> receiver,
mojo::PendingAssociatedRemote<search::mojom::EmbeddedSearchClient> client) { … }
SearchIPCRouter::SearchIPCRouter(content::WebContents* web_contents,
Delegate* delegate,
std::unique_ptr<Policy> policy)
: … { … }
SearchIPCRouter::~SearchIPCRouter() = default;
void SearchIPCRouter::BindEmbeddedSearchConnecter(
mojo::PendingAssociatedReceiver<search::mojom::EmbeddedSearchConnector>
receiver,
content::RenderFrameHost* rfh) { … }
void SearchIPCRouter::OnNavigationEntryCommitted() { … }
void SearchIPCRouter::SetInputInProgress(bool input_in_progress) { … }
void SearchIPCRouter::OmniboxFocusChanged(OmniboxFocusState state,
OmniboxFocusChangeReason reason) { … }
void SearchIPCRouter::SendMostVisitedInfo(
const InstantMostVisitedInfo& most_visited_info) { … }
void SearchIPCRouter::SendNtpTheme(const NtpTheme& theme) { … }
void SearchIPCRouter::OnTabActivated() { … }
void SearchIPCRouter::OnTabDeactivated() { … }
void SearchIPCRouter::FocusOmnibox(int page_seq_no, bool focus) { … }
void SearchIPCRouter::DeleteMostVisitedItem(int page_seq_no, const GURL& url) { … }
void SearchIPCRouter::UndoMostVisitedDeletion(int page_seq_no,
const GURL& url) { … }
void SearchIPCRouter::UndoAllMostVisitedDeletions(int page_seq_no) { … }
void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { … }
void SearchIPCRouter::set_policy_for_testing(std::unique_ptr<Policy> policy) { … }