#include "chrome/browser/preloading/preview/preview_tab.h"
#include "base/features.h"
#include "build/buildflag.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h"
#include "chrome/browser/preloading/preview/preview_manager.h"
#include "chrome/browser/preloading/preview/preview_zoom_controller.h"
#include "chrome/browser/ssl/chrome_security_state_tab_helper.h"
#include "chrome/browser/ui/tab_helpers.h"
#include "components/zoom/zoom_controller.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/preview_cancel_reason.h"
#include "content/public/browser/web_contents_observer.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/mojom/window_features/window_features.mojom.h"
#if defined(USE_AURA)
#include "ui/aura/window.h"
#endif
#include "ui/base/page_transition_types.h"
#include "ui/base/ui_base_types.h"
#include "ui/base/window_open_disposition.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/widget/widget.h"
namespace {
content::WebContents::CreateParams CreateWebContentsCreateParams(
content::BrowserContext* context) { … }
std::unique_ptr<views::Widget> CreateWidget(content::WebContents& parent,
views::View* view,
views::WidgetObserver* observer) { … }
}
PreviewTab::PreviewTab(PreviewManager* preview_manager,
content::WebContents& initiator_web_contents,
const GURL& url)
: … { … }
PreviewTab::~PreviewTab() = default;
base::WeakPtr<content::WebContents> PreviewTab::GetWebContents() { … }
void PreviewTab::AttachTabHelpersForInit() { … }
bool PreviewTab::AuditWebInputEvent(const blink::WebInputEvent& event) { … }
content::PreloadingEligibility PreviewTab::IsPrerender2Supported(
content::WebContents& web_contents) { … }
void PreviewTab::CancelPreview(content::PreviewCancelReason reason) { … }
void PreviewTab::PromoteToNewTab(content::WebContents& initiator_web_contents) { … }
void PreviewTab::Activate(base::WeakPtr<content::WebContents> web_contents) { … }
struct AcceleratorMapping { … };
constexpr AcceleratorMapping kAcceleratorMap[] = …;
void PreviewTab::RegisterKeyboardAccelerators() { … }
bool PreviewTab::CanHandleAccelerators() const { … }
bool PreviewTab::AcceleratorPressed(const ui::Accelerator& accelerator) { … }
void PreviewTab::OnWidgetActivationChanged(views::Widget* widget, bool active) { … }