#include "chrome/browser/ui/side_search/side_search_side_contents_helper.h"
#include "build/build_config.h"
#include "chrome/browser/ui/side_search/side_search_config.h"
#include "chrome/browser/ui/side_search/side_search_metrics.h"
#include "chrome/browser/ui/side_search/side_search_tab_contents_helper.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/web_contents.h"
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
#include "url/gurl.h"
namespace {
class SideSearchContentsThrottle : public content::NavigationThrottle { … };
}
void SideSearchSideContentsHelper::DidOpenRequestedURL(
content::WebContents* new_contents,
content::RenderFrameHost* source_render_frame_host,
const GURL& url,
const content::Referrer& referrer,
WindowOpenDisposition disposition,
ui::PageTransition transition,
bool started_from_context_menu,
bool renderer_initiated) { … }
bool SideSearchSideContentsHelper::Delegate::HandleKeyboardEvent(
content::WebContents* source,
const input::NativeWebKeyboardEvent& event) { … }
content::WebContents* SideSearchSideContentsHelper::Delegate::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params,
base::OnceCallback<void(content::NavigationHandle&)>
navigation_handle_callback) { … }
SideSearchSideContentsHelper::~SideSearchSideContentsHelper() { … }
std::unique_ptr<content::NavigationThrottle>
SideSearchSideContentsHelper::MaybeCreateThrottleFor(
content::NavigationHandle* handle) { … }
void SideSearchSideContentsHelper::PrimaryPageChanged(content::Page& page) { … }
void SideSearchSideContentsHelper::PrimaryMainFrameRenderProcessGone(
base::TerminationStatus status) { … }
bool SideSearchSideContentsHelper::CanDragEnter(
content::WebContents* source,
const content::DropData& data,
blink::DragOperationsMask operations_allowed) { … }
bool SideSearchSideContentsHelper::HandleKeyboardEvent(
content::WebContents* source,
const input::NativeWebKeyboardEvent& event) { … }
content::WebContents* SideSearchSideContentsHelper::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params,
base::OnceCallback<void(content::NavigationHandle&)>
navigation_handle_callback) { … }
void SideSearchSideContentsHelper::NavigateInTabContents(
const content::OpenURLParams& params) { … }
void SideSearchSideContentsHelper::LoadURL(const GURL& url) { … }
content::WebContents* SideSearchSideContentsHelper::GetTabWebContents() { … }
void SideSearchSideContentsHelper::SetDelegate(Delegate* delegate) { … }
SideSearchSideContentsHelper::SideSearchSideContentsHelper(
content::WebContents* web_contents)
: … { … }
void SideSearchSideContentsHelper::MaybeRecordMetricsPerJourney() { … }
SideSearchConfig* SideSearchSideContentsHelper::GetConfig() { … }
WEB_CONTENTS_USER_DATA_KEY_IMPL(SideSearchSideContentsHelper);