2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright (c) 2011 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "include/cef_browser.h"
|
|
|
|
#include "include/cef_client.h"
|
|
|
|
#include "include/cef_frame.h"
|
2016-01-19 21:09:01 +01:00
|
|
|
#include "include/views/cef_browser_view.h"
|
2015-10-21 20:17:09 +02:00
|
|
|
#include "libcef/browser/browser_info.h"
|
2015-11-17 19:20:13 +01:00
|
|
|
#include "libcef/browser/file_dialog_manager.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef/browser/frame_host_impl.h"
|
2013-02-23 01:43:28 +01:00
|
|
|
#include "libcef/browser/javascript_dialog_manager.h"
|
2015-11-17 19:20:13 +01:00
|
|
|
#include "libcef/browser/menu_manager.h"
|
2019-03-24 00:40:32 +01:00
|
|
|
#include "libcef/browser/request_context_impl.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-02-12 23:31:22 +01:00
|
|
|
#include "base/observer_list.h"
|
2013-06-22 04:06:32 +02:00
|
|
|
#include "base/strings/string16.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "base/synchronization/lock.h"
|
|
|
|
#include "content/public/browser/notification_observer.h"
|
|
|
|
#include "content/public/browser/notification_registrar.h"
|
2012-04-04 20:18:09 +02:00
|
|
|
#include "content/public/browser/web_contents.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "content/public/browser/web_contents_delegate.h"
|
|
|
|
#include "content/public/browser/web_contents_observer.h"
|
2017-08-04 00:55:19 +02:00
|
|
|
#include "extensions/common/view_type.h"
|
2012-11-21 01:40:15 +01:00
|
|
|
|
2016-11-23 21:54:29 +01:00
|
|
|
namespace content {
|
|
|
|
struct DragEventSourceInfo;
|
|
|
|
class RenderWidgetHostImpl;
|
2017-07-27 01:19:27 +02:00
|
|
|
} // namespace content
|
2016-11-23 21:54:29 +01:00
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
namespace extensions {
|
|
|
|
class Extension;
|
|
|
|
class ExtensionHost;
|
|
|
|
} // namespace extensions
|
|
|
|
|
2016-01-19 21:09:01 +01:00
|
|
|
#if defined(USE_AURA)
|
|
|
|
namespace views {
|
|
|
|
class Widget;
|
|
|
|
}
|
|
|
|
#endif // defined(USE_AURA)
|
|
|
|
|
2012-12-30 12:17:49 +01:00
|
|
|
class CefBrowserInfo;
|
2016-01-19 21:09:01 +01:00
|
|
|
class CefBrowserPlatformDelegate;
|
2013-11-08 17:06:06 +01:00
|
|
|
class CefDevToolsFrontend;
|
2012-04-03 03:34:16 +02:00
|
|
|
class SiteInstance;
|
|
|
|
|
|
|
|
// Implementation of CefBrowser.
|
|
|
|
//
|
2012-04-04 20:18:09 +02:00
|
|
|
// WebContentsDelegate: Interface for handling WebContents delegations. There is
|
|
|
|
// a one-to-one relationship between CefBrowserHostImpl and WebContents
|
2012-04-03 03:34:16 +02:00
|
|
|
// instances.
|
|
|
|
//
|
2012-04-04 20:18:09 +02:00
|
|
|
// WebContentsObserver: Interface for observing WebContents notifications and
|
|
|
|
// IPC messages. There is a one-to-one relationship between WebContents and
|
2012-04-03 03:34:16 +02:00
|
|
|
// RenderViewHost instances. IPC messages received by the RenderViewHost will be
|
2012-04-04 20:18:09 +02:00
|
|
|
// forwarded to this WebContentsObserver implementation via WebContents. IPC
|
2012-04-03 03:34:16 +02:00
|
|
|
// messages sent using CefBrowserHostImpl::Send() will be forwarded to the
|
|
|
|
// RenderViewHost (after posting to the UI thread if necessary). Use
|
|
|
|
// WebContentsObserver::routing_id() when sending IPC messages.
|
|
|
|
//
|
|
|
|
// NotificationObserver: Interface for observing post-processed notifications.
|
|
|
|
class CefBrowserHostImpl : public CefBrowserHost,
|
|
|
|
public CefBrowser,
|
|
|
|
public content::WebContentsDelegate,
|
|
|
|
public content::WebContentsObserver,
|
|
|
|
public content::NotificationObserver {
|
|
|
|
public:
|
|
|
|
// Used for handling the response to command messages.
|
2017-02-09 23:07:43 +01:00
|
|
|
class CommandResponseHandler : public virtual CefBaseRefCounted {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
2017-05-17 11:29:28 +02:00
|
|
|
virtual void OnResponse(const std::string& response) = 0;
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
2016-02-12 23:31:22 +01:00
|
|
|
// Interface to implement for observers that wish to be informed of changes
|
|
|
|
// to the CefBrowserHostImpl. All methods will be called on the UI thread.
|
|
|
|
class Observer {
|
|
|
|
public:
|
|
|
|
// Called before |browser| is destroyed. Any references to |browser| should
|
|
|
|
// be cleared when this method is called.
|
2017-05-17 11:29:28 +02:00
|
|
|
virtual void OnBrowserDestroyed(CefBrowserHostImpl* browser) = 0;
|
2016-02-12 23:31:22 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~Observer() {}
|
|
|
|
};
|
|
|
|
|
2014-11-12 20:25:15 +01:00
|
|
|
~CefBrowserHostImpl() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-01-19 21:09:01 +01:00
|
|
|
struct CreateParams {
|
|
|
|
// Platform-specific window creation info. Will be nullptr when creating a
|
|
|
|
// views-hosted browser.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefWindowInfo> window_info;
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
#if defined(USE_AURA)
|
|
|
|
// The BrowserView that will own a views-hosted browser. Will be nullptr for
|
|
|
|
// popup browsers (the BrowserView will be created later in that case).
|
|
|
|
CefRefPtr<CefBrowserView> browser_view;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Client implementation. May be nullptr.
|
|
|
|
CefRefPtr<CefClient> client;
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// Initial URL to load. May be empty. If this is a valid extension URL then
|
|
|
|
// the browser will be created as an app view extension host.
|
|
|
|
GURL url;
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
// Browser settings.
|
|
|
|
CefBrowserSettings settings;
|
|
|
|
|
|
|
|
// Other browser that opened this DevTools browser. Will be nullptr for non-
|
|
|
|
// DevTools browsers.
|
|
|
|
CefRefPtr<CefBrowserHostImpl> devtools_opener;
|
|
|
|
|
|
|
|
// Request context to use when creating the browser. If nullptr the global
|
|
|
|
// request context will be used.
|
|
|
|
CefRefPtr<CefRequestContext> request_context;
|
2017-08-04 00:55:19 +02:00
|
|
|
|
2019-03-19 10:42:54 +01:00
|
|
|
CefRefPtr<CefDictionaryValue> extra_info;
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// Used when explicitly creating the browser as an extension host via
|
|
|
|
// ProcessManager::CreateBackgroundHost.
|
|
|
|
const extensions::Extension* extension = nullptr;
|
|
|
|
extensions::ViewType extension_host_type = extensions::VIEW_TYPE_INVALID;
|
2016-01-19 21:09:01 +01:00
|
|
|
};
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Create a new CefBrowserHostImpl instance.
|
2016-01-19 21:09:01 +01:00
|
|
|
static CefRefPtr<CefBrowserHostImpl> Create(CreateParams& create_params);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Returns the browser associated with the specified RenderViewHost.
|
|
|
|
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost(
|
|
|
|
const content::RenderViewHost* host);
|
2014-01-02 23:41:11 +01:00
|
|
|
// Returns the browser associated with the specified RenderFrameHost.
|
|
|
|
static CefRefPtr<CefBrowserHostImpl> GetBrowserForHost(
|
|
|
|
const content::RenderFrameHost* host);
|
2012-04-03 03:34:16 +02:00
|
|
|
// Returns the browser associated with the specified WebContents.
|
|
|
|
static CefRefPtr<CefBrowserHostImpl> GetBrowserForContents(
|
2015-07-16 23:40:01 +02:00
|
|
|
const content::WebContents* contents);
|
2019-05-24 22:23:43 +02:00
|
|
|
// Returns the browser associated with the specified FrameTreeNode ID.
|
2017-10-26 20:17:00 +02:00
|
|
|
static CefRefPtr<CefBrowserHostImpl> GetBrowserForFrameTreeNode(
|
|
|
|
int frame_tree_node_id);
|
2014-01-02 23:41:11 +01:00
|
|
|
// Returns the browser associated with the specified frame routing IDs.
|
2019-05-24 22:23:43 +02:00
|
|
|
static CefRefPtr<CefBrowserHostImpl> GetBrowserForFrameRoute(
|
2017-05-17 11:29:28 +02:00
|
|
|
int render_process_id,
|
|
|
|
int render_routing_id);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// CefBrowserHost methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
CefRefPtr<CefBrowser> GetBrowser() override;
|
|
|
|
void CloseBrowser(bool force_close) override;
|
2016-01-19 21:09:01 +01:00
|
|
|
bool TryCloseBrowser() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void SetFocus(bool focus) override;
|
|
|
|
CefWindowHandle GetWindowHandle() override;
|
|
|
|
CefWindowHandle GetOpenerWindowHandle() override;
|
2016-01-19 21:09:01 +01:00
|
|
|
bool HasView() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
CefRefPtr<CefClient> GetClient() override;
|
|
|
|
CefRefPtr<CefRequestContext> GetRequestContext() override;
|
|
|
|
double GetZoomLevel() override;
|
|
|
|
void SetZoomLevel(double zoomLevel) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
void RunFileDialog(FileDialogMode mode,
|
|
|
|
const CefString& title,
|
|
|
|
const CefString& default_file_path,
|
|
|
|
const std::vector<CefString>& accept_filters,
|
|
|
|
int selected_accept_filter,
|
|
|
|
CefRefPtr<CefRunFileDialogCallback> callback) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void StartDownload(const CefString& url) override;
|
2016-01-19 21:09:01 +01:00
|
|
|
void DownloadImage(const CefString& image_url,
|
|
|
|
bool is_favicon,
|
|
|
|
uint32 max_image_size,
|
|
|
|
bool bypass_cache,
|
|
|
|
CefRefPtr<CefDownloadImageCallback> callback) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void Print() override;
|
2015-03-24 16:40:08 +01:00
|
|
|
void PrintToPDF(const CefString& path,
|
|
|
|
const CefPdfPrintSettings& settings,
|
|
|
|
CefRefPtr<CefPdfPrintCallback> callback) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
void Find(int identifier,
|
|
|
|
const CefString& searchText,
|
|
|
|
bool forward,
|
|
|
|
bool matchCase,
|
|
|
|
bool findNext) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void StopFinding(bool clearSelection) override;
|
|
|
|
void ShowDevTools(const CefWindowInfo& windowInfo,
|
|
|
|
CefRefPtr<CefClient> client,
|
|
|
|
const CefBrowserSettings& settings,
|
|
|
|
const CefPoint& inspect_element_at) override;
|
|
|
|
void CloseDevTools() override;
|
2016-06-10 20:33:07 +02:00
|
|
|
bool HasDevTools() override;
|
2017-05-17 11:29:28 +02:00
|
|
|
void GetNavigationEntries(CefRefPtr<CefNavigationEntryVisitor> visitor,
|
|
|
|
bool current_only) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void SetMouseCursorChangeDisabled(bool disabled) override;
|
|
|
|
bool IsMouseCursorChangeDisabled() override;
|
|
|
|
bool IsWindowRenderingDisabled() override;
|
|
|
|
void ReplaceMisspelling(const CefString& word) override;
|
|
|
|
void AddWordToDictionary(const CefString& word) override;
|
|
|
|
void WasResized() override;
|
|
|
|
void WasHidden(bool hidden) override;
|
|
|
|
void NotifyScreenInfoChanged() override;
|
|
|
|
void Invalidate(PaintElementType type) override;
|
2018-07-03 02:46:03 +02:00
|
|
|
void SendExternalBeginFrame() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void SendKeyEvent(const CefKeyEvent& event) override;
|
|
|
|
void SendMouseClickEvent(const CefMouseEvent& event,
|
|
|
|
MouseButtonType type,
|
2017-05-17 11:29:28 +02:00
|
|
|
bool mouseUp,
|
|
|
|
int clickCount) override;
|
|
|
|
void SendMouseMoveEvent(const CefMouseEvent& event, bool mouseLeave) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void SendMouseWheelEvent(const CefMouseEvent& event,
|
2017-05-17 11:29:28 +02:00
|
|
|
int deltaX,
|
|
|
|
int deltaY) override;
|
2019-02-25 22:17:28 +01:00
|
|
|
void SendTouchEvent(const CefTouchEvent& event) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void SendFocusEvent(bool setFocus) override;
|
|
|
|
void SendCaptureLostEvent() override;
|
|
|
|
void NotifyMoveOrResizeStarted() override;
|
2015-05-13 17:43:50 +02:00
|
|
|
int GetWindowlessFrameRate() override;
|
|
|
|
void SetWindowlessFrameRate(int frame_rate) override;
|
2016-10-28 18:11:24 +02:00
|
|
|
void ImeSetComposition(const CefString& text,
|
|
|
|
const std::vector<CefCompositionUnderline>& underlines,
|
|
|
|
const CefRange& replacement_range,
|
|
|
|
const CefRange& selection_range) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
void ImeCommitText(const CefString& text,
|
|
|
|
const CefRange& replacement_range,
|
2016-10-28 18:11:24 +02:00
|
|
|
int relative_cursor_pos) override;
|
|
|
|
void ImeFinishComposingText(bool keep_selection) override;
|
|
|
|
void ImeCancelComposition() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void DragTargetDragEnter(CefRefPtr<CefDragData> drag_data,
|
|
|
|
const CefMouseEvent& event,
|
|
|
|
DragOperationsMask allowed_ops) override;
|
|
|
|
void DragTargetDragOver(const CefMouseEvent& event,
|
|
|
|
DragOperationsMask allowed_ops) override;
|
|
|
|
void DragTargetDragLeave() override;
|
|
|
|
void DragTargetDrop(const CefMouseEvent& event) override;
|
|
|
|
void DragSourceSystemDragEnded() override;
|
|
|
|
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
2019-02-26 17:44:17 +01:00
|
|
|
void SetAudioMuted(bool mute) override;
|
|
|
|
bool IsAudioMuted() override;
|
2016-09-02 12:01:33 +02:00
|
|
|
CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() override;
|
2017-05-12 20:28:25 +02:00
|
|
|
void SetAccessibilityState(cef_state_t accessibility_state) override;
|
2017-08-04 00:55:19 +02:00
|
|
|
void SetAutoResizeEnabled(bool enabled,
|
|
|
|
const CefSize& min_size,
|
|
|
|
const CefSize& max_size) override;
|
|
|
|
CefRefPtr<CefExtension> GetExtension() override;
|
|
|
|
bool IsBackgroundHost() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// CefBrowser methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
CefRefPtr<CefBrowserHost> GetHost() override;
|
|
|
|
bool CanGoBack() override;
|
|
|
|
void GoBack() override;
|
|
|
|
bool CanGoForward() override;
|
|
|
|
void GoForward() override;
|
|
|
|
bool IsLoading() override;
|
|
|
|
void Reload() override;
|
|
|
|
void ReloadIgnoreCache() override;
|
|
|
|
void StopLoad() override;
|
|
|
|
int GetIdentifier() override;
|
|
|
|
bool IsSame(CefRefPtr<CefBrowser> that) override;
|
|
|
|
bool IsPopup() override;
|
|
|
|
bool HasDocument() override;
|
|
|
|
CefRefPtr<CefFrame> GetMainFrame() override;
|
|
|
|
CefRefPtr<CefFrame> GetFocusedFrame() override;
|
|
|
|
CefRefPtr<CefFrame> GetFrame(int64 identifier) override;
|
|
|
|
CefRefPtr<CefFrame> GetFrame(const CefString& name) override;
|
|
|
|
size_t GetFrameCount() override;
|
|
|
|
void GetFrameIdentifiers(std::vector<int64>& identifiers) override;
|
|
|
|
void GetFrameNames(std::vector<CefString>& names) override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
// Returns true if windowless rendering is enabled.
|
|
|
|
bool IsWindowless() const;
|
|
|
|
|
2016-01-19 21:09:01 +01:00
|
|
|
// Returns true if this browser is views-hosted.
|
|
|
|
bool IsViewsHosted() const;
|
|
|
|
|
2019-07-17 20:47:27 +02:00
|
|
|
// Returns true if this browser supports print preview.
|
|
|
|
bool IsPrintPreviewSupported() const;
|
|
|
|
|
2019-10-15 13:11:59 +02:00
|
|
|
// Returns true if this browser supports picture-in-picture.
|
|
|
|
bool IsPictureInPictureSupported() const;
|
|
|
|
|
2013-03-19 23:59:33 +01:00
|
|
|
// Called when the OS window hosting the browser is destroyed.
|
|
|
|
void WindowDestroyed();
|
2012-11-21 01:40:15 +01:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Destroy the browser members. This method should only be called after the
|
|
|
|
// native browser window is not longer processing messages.
|
|
|
|
void DestroyBrowser();
|
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
// Cancel display of the context menu, if any.
|
|
|
|
void CancelContextMenu();
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
#if defined(USE_AURA)
|
|
|
|
// Returns the Widget owner for the browser window. Only used with windowed
|
|
|
|
// rendering.
|
|
|
|
views::Widget* GetWindowWidget() const;
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
// Returns the BrowserView associated with this browser. Only used with views-
|
|
|
|
// based browsers.
|
|
|
|
CefRefPtr<CefBrowserView> GetBrowserView() const;
|
2015-11-17 19:20:13 +01:00
|
|
|
#endif
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
// Returns the frame associated with the specified RenderFrameHost.
|
|
|
|
CefRefPtr<CefFrame> GetFrameForHost(const content::RenderFrameHost* host);
|
|
|
|
|
2019-06-12 11:48:57 +02:00
|
|
|
// Returns the frame associated with the specified FrameTreeNode ID.
|
|
|
|
CefRefPtr<CefFrame> GetFrameForFrameTreeNode(int frame_tree_node_id);
|
|
|
|
|
2019-05-24 22:23:43 +02:00
|
|
|
// Load the specified URL in the main frame.
|
|
|
|
void LoadMainFrameURL(const std::string& url,
|
|
|
|
const content::Referrer& referrer,
|
|
|
|
ui::PageTransition transition,
|
|
|
|
const std::string& extra_headers);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2019-05-24 22:23:43 +02:00
|
|
|
// Called from CefFrameHostImpl.
|
|
|
|
void OnDidFinishLoad(CefRefPtr<CefFrameHostImpl> frame,
|
|
|
|
const GURL& validated_url,
|
|
|
|
int http_status_code);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Open the specified text in the default text editor.
|
2015-11-17 19:20:13 +01:00
|
|
|
void ViewText(const std::string& text);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-01-19 21:09:01 +01:00
|
|
|
// Convert from view coordinates to screen coordinates. Potential display
|
|
|
|
// scaling will be applied to the result.
|
2015-11-17 19:20:13 +01:00
|
|
|
gfx::Point GetScreenPoint(const gfx::Point& view) const;
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void StartDragging(const content::DropData& drop_data,
|
|
|
|
blink::WebDragOperationsMask allowed_ops,
|
|
|
|
const gfx::ImageSkia& image,
|
|
|
|
const gfx::Vector2d& image_offset,
|
|
|
|
const content::DragEventSourceInfo& event_info,
|
|
|
|
content::RenderWidgetHostImpl* source_rwh);
|
2016-11-23 21:54:29 +01:00
|
|
|
void UpdateDragCursor(blink::WebDragOperation operation);
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Thread safe accessors.
|
|
|
|
const CefBrowserSettings& settings() const { return settings_; }
|
2017-04-20 21:28:17 +02:00
|
|
|
SkColor GetBackgroundColor() const;
|
2012-04-03 03:34:16 +02:00
|
|
|
CefRefPtr<CefClient> client() const { return client_; }
|
2015-10-21 20:17:09 +02:00
|
|
|
scoped_refptr<CefBrowserInfo> browser_info() const { return browser_info_; }
|
2012-12-30 12:17:49 +01:00
|
|
|
int browser_id() const;
|
2019-03-24 00:40:32 +01:00
|
|
|
CefRefPtr<CefRequestContextImpl> request_context() const {
|
|
|
|
return request_context_;
|
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// Accessors that must be called on the UI thread.
|
|
|
|
content::BrowserContext* GetBrowserContext();
|
|
|
|
extensions::ExtensionHost* extension_host() const { return extension_host_; }
|
|
|
|
|
2012-06-11 18:51:51 +02:00
|
|
|
void OnSetFocus(cef_focus_source_t source);
|
|
|
|
|
2012-10-16 21:28:07 +02:00
|
|
|
// Run the file chooser dialog specified by |params|. Only a single dialog may
|
|
|
|
// be pending at any given time. |callback| will be executed asynchronously
|
|
|
|
// after the dialog is dismissed or if another dialog is already pending.
|
2020-03-04 01:29:39 +01:00
|
|
|
void RunFileChooser(const CefFileDialogRunner::FileChooserParams& params,
|
|
|
|
CefFileDialogRunner::RunFileChooserCallback callback);
|
2012-10-16 21:28:07 +02:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
bool HandleContextMenu(content::WebContents* web_contents,
|
|
|
|
const content::ContextMenuParams& params);
|
2015-07-16 23:40:01 +02:00
|
|
|
|
|
|
|
// Returns the WebContents most likely to handle an action. If extensions are
|
|
|
|
// enabled and this browser has a full-page guest (for example, a full-page
|
|
|
|
// PDF viewer extension) then the guest's WebContents will be returned.
|
|
|
|
// Otherwise, the browser's WebContents will be returned.
|
2019-07-17 20:47:27 +02:00
|
|
|
content::WebContents* GetActionableWebContents() const;
|
2015-07-16 23:40:01 +02:00
|
|
|
|
2013-03-19 23:59:33 +01:00
|
|
|
enum DestructionState {
|
|
|
|
DESTRUCTION_STATE_NONE = 0,
|
|
|
|
DESTRUCTION_STATE_PENDING,
|
|
|
|
DESTRUCTION_STATE_ACCEPTED,
|
|
|
|
DESTRUCTION_STATE_COMPLETED
|
|
|
|
};
|
|
|
|
DestructionState destruction_state() const { return destruction_state_; }
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// content::WebContentsDelegate methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
content::WebContents* OpenURLFromTab(
|
2012-04-03 03:34:16 +02:00
|
|
|
content::WebContents* source,
|
2014-11-12 20:25:15 +01:00
|
|
|
const content::OpenURLParams& params) override;
|
2017-08-04 00:55:19 +02:00
|
|
|
bool ShouldTransferNavigation(bool is_main_frame_navigation) override;
|
|
|
|
void AddNewContents(content::WebContents* source,
|
2018-05-18 12:45:18 +02:00
|
|
|
std::unique_ptr<content::WebContents> new_contents,
|
2017-08-04 00:55:19 +02:00
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const gfx::Rect& initial_rect,
|
|
|
|
bool user_gesture,
|
|
|
|
bool* was_blocked) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void LoadingStateChanged(content::WebContents* source,
|
|
|
|
bool to_different_document) override;
|
2020-02-10 18:10:17 +01:00
|
|
|
void LoadProgressChanged(double progress) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void CloseContents(content::WebContents* source) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
|
2016-11-23 21:54:29 +01:00
|
|
|
bool DidAddMessageToConsole(content::WebContents* source,
|
2019-07-16 19:59:21 +02:00
|
|
|
blink::mojom::ConsoleMessageLevel log_level,
|
2016-11-23 21:54:29 +01:00
|
|
|
const base::string16& message,
|
|
|
|
int32_t line_no,
|
|
|
|
const base::string16& source_id) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void BeforeUnloadFired(content::WebContents* source,
|
|
|
|
bool proceed,
|
|
|
|
bool* proceed_to_fire_unload) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
bool TakeFocus(content::WebContents* source, bool reverse) override;
|
2019-03-13 22:27:37 +01:00
|
|
|
|
|
|
|
bool HandleContextMenu(content::RenderFrameHost* render_frame_host,
|
|
|
|
const content::ContextMenuParams& params) override;
|
2017-04-20 21:28:17 +02:00
|
|
|
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
|
2012-08-29 00:26:35 +02:00
|
|
|
content::WebContents* source,
|
2017-04-20 21:28:17 +02:00
|
|
|
const content::NativeWebKeyboardEvent& event) override;
|
2018-11-03 02:15:09 +01:00
|
|
|
bool HandleKeyboardEvent(
|
2012-08-29 00:26:35 +02:00
|
|
|
content::WebContents* source,
|
2014-11-12 20:25:15 +01:00
|
|
|
const content::NativeWebKeyboardEvent& event) override;
|
2017-08-04 00:55:19 +02:00
|
|
|
bool PreHandleGestureEvent(content::WebContents* source,
|
|
|
|
const blink::WebGestureEvent& event) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
bool CanDragEnter(content::WebContents* source,
|
|
|
|
const content::DropData& data,
|
|
|
|
blink::WebDragOperationsMask operations_allowed) override;
|
2017-02-10 23:44:11 +01:00
|
|
|
void GetCustomWebContentsView(
|
2014-07-01 00:30:29 +02:00
|
|
|
content::WebContents* web_contents,
|
|
|
|
const GURL& target_url,
|
2017-03-15 23:04:16 +01:00
|
|
|
int opener_render_process_id,
|
|
|
|
int opener_render_frame_id,
|
2014-07-01 00:30:29 +02:00
|
|
|
content::WebContentsView** view,
|
2014-11-12 20:25:15 +01:00
|
|
|
content::RenderViewHostDelegateView** delegate_view) override;
|
2017-07-27 01:19:27 +02:00
|
|
|
void WebContentsCreated(content::WebContents* source_contents,
|
|
|
|
int opener_render_process_id,
|
|
|
|
int opener_render_frame_id,
|
|
|
|
const std::string& frame_name,
|
|
|
|
const GURL& target_url,
|
|
|
|
content::WebContents* new_contents) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void DidNavigateMainFramePostCommit(
|
2015-01-20 19:24:54 +01:00
|
|
|
content::WebContents* web_contents) override;
|
2014-12-13 21:18:31 +01:00
|
|
|
content::JavaScriptDialogManager* GetJavaScriptDialogManager(
|
|
|
|
content::WebContents* source) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
void RunFileChooser(content::RenderFrameHost* render_frame_host,
|
2018-10-24 22:37:39 +02:00
|
|
|
std::unique_ptr<content::FileSelectListener> listener,
|
2018-10-02 14:14:11 +02:00
|
|
|
const blink::mojom::FileChooserParams& params) override;
|
2019-09-04 17:13:32 +02:00
|
|
|
bool EmbedsFullscreenWidget() override;
|
2018-05-20 15:51:42 +02:00
|
|
|
void EnterFullscreenModeForTab(
|
|
|
|
content::WebContents* web_contents,
|
|
|
|
const GURL& origin,
|
2019-11-12 17:11:44 +01:00
|
|
|
const blink::mojom::FullscreenOptions& options) override;
|
2015-06-05 00:33:24 +02:00
|
|
|
void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
|
|
|
|
bool IsFullscreenForTabOrPending(
|
2019-09-04 17:13:32 +02:00
|
|
|
const content::WebContents* web_contents) override;
|
2019-11-12 17:11:44 +01:00
|
|
|
blink::mojom::DisplayMode GetDisplayMode(
|
2019-09-04 17:13:32 +02:00
|
|
|
const content::WebContents* web_contents) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
void FindReply(content::WebContents* web_contents,
|
|
|
|
int request_id,
|
|
|
|
int number_of_matches,
|
|
|
|
const gfx::Rect& selection_rect,
|
|
|
|
int active_match_ordinal,
|
|
|
|
bool final_update) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void UpdatePreferredSize(content::WebContents* source,
|
2015-06-05 00:33:24 +02:00
|
|
|
const gfx::Size& pref_size) override;
|
2017-08-04 00:55:19 +02:00
|
|
|
void ResizeDueToAutoResize(content::WebContents* source,
|
|
|
|
const gfx::Size& new_size) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void RequestMediaAccessPermission(
|
2012-06-22 00:50:34 +02:00
|
|
|
content::WebContents* web_contents,
|
2013-01-15 20:12:28 +01:00
|
|
|
const content::MediaStreamRequest& request,
|
2018-06-19 00:08:20 +02:00
|
|
|
content::MediaResponseCallback callback) override;
|
2018-04-19 17:44:42 +02:00
|
|
|
bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
|
2015-03-25 22:22:47 +01:00
|
|
|
const GURL& security_origin,
|
2019-09-04 17:13:32 +02:00
|
|
|
blink::mojom::MediaStreamType type) override;
|
2020-03-04 01:29:39 +01:00
|
|
|
bool IsNeverComposited(content::WebContents* web_contents) override;
|
2019-10-15 13:11:59 +02:00
|
|
|
content::PictureInPictureResult EnterPictureInPicture(
|
|
|
|
content::WebContents* web_contents,
|
|
|
|
const viz::SurfaceId& surface_id,
|
|
|
|
const gfx::Size& natural_size) override;
|
|
|
|
void ExitPictureInPicture() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// content::WebContentsObserver methods.
|
2013-07-19 01:25:28 +02:00
|
|
|
using content::WebContentsObserver::BeforeUnloadFired;
|
2017-03-03 23:37:23 +01:00
|
|
|
void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
|
2017-10-26 20:17:00 +02:00
|
|
|
void RenderFrameHostChanged(content::RenderFrameHost* old_host,
|
|
|
|
content::RenderFrameHost* new_host) override;
|
2019-05-24 22:23:43 +02:00
|
|
|
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
2017-03-03 23:37:23 +01:00
|
|
|
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
|
|
|
void RenderViewDeleted(content::RenderViewHost* render_view_host) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void RenderViewReady() override;
|
|
|
|
void RenderProcessGone(base::TerminationStatus status) override;
|
2017-03-03 23:37:23 +01:00
|
|
|
void DidFinishNavigation(
|
|
|
|
content::NavigationHandle* navigation_handle) override;
|
2018-10-24 22:37:39 +02:00
|
|
|
void DidStopLoading() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void DocumentAvailableInMainFrame() override;
|
|
|
|
void DidFailLoad(content::RenderFrameHost* render_frame_host,
|
|
|
|
const GURL& validated_url,
|
2020-03-04 01:29:39 +01:00
|
|
|
int error_code) override;
|
2017-10-20 19:45:20 +02:00
|
|
|
void TitleWasSet(content::NavigationEntry* entry) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void PluginCrashed(const base::FilePath& plugin_path,
|
|
|
|
base::ProcessId plugin_pid) override;
|
2015-01-12 20:37:52 +01:00
|
|
|
void DidUpdateFaviconURL(
|
|
|
|
const std::vector<content::FaviconURL>& candidates) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool OnMessageReceived(const IPC::Message& message) override;
|
2017-05-31 17:33:30 +02:00
|
|
|
bool OnMessageReceived(const IPC::Message& message,
|
|
|
|
content::RenderFrameHost* render_frame_host) override;
|
2020-02-10 18:10:17 +01:00
|
|
|
void OnFrameFocused(content::RenderFrameHost* render_frame_host) override;
|
2017-05-12 20:28:25 +02:00
|
|
|
void AccessibilityEventReceived(
|
2018-06-08 18:53:10 +02:00
|
|
|
const content::AXEventNotificationDetails& content_event_bundle) override;
|
2017-05-12 20:28:25 +02:00
|
|
|
void AccessibilityLocationChangesReceived(
|
|
|
|
const std::vector<content::AXLocationChangeNotificationDetails>& locData)
|
|
|
|
override;
|
|
|
|
|
2017-07-27 01:19:27 +02:00
|
|
|
void OnWebContentsFocused(
|
|
|
|
content::RenderWidgetHost* render_widget_host) override;
|
2017-10-20 19:45:20 +02:00
|
|
|
|
2016-02-12 23:31:22 +01:00
|
|
|
// Manage observer objects. The observer must either outlive this object or
|
|
|
|
// remove itself before destruction. These methods can only be called on the
|
|
|
|
// UI thread.
|
|
|
|
void AddObserver(Observer* observer);
|
|
|
|
void RemoveObserver(Observer* observer);
|
|
|
|
bool HasObserver(Observer* observer) const;
|
2018-06-19 00:08:20 +02:00
|
|
|
class NavigationLock final {
|
|
|
|
private:
|
|
|
|
friend class CefBrowserHostImpl;
|
|
|
|
friend std::unique_ptr<NavigationLock>::deleter_type;
|
|
|
|
|
|
|
|
explicit NavigationLock(CefRefPtr<CefBrowserHostImpl> browser);
|
|
|
|
~NavigationLock();
|
|
|
|
|
|
|
|
CefRefPtr<CefBrowserHostImpl> browser_;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Block navigation-related events on NavigationLock life span.
|
|
|
|
std::unique_ptr<NavigationLock> CreateNavigationLock();
|
|
|
|
|
2014-07-08 00:17:33 +02:00
|
|
|
private:
|
|
|
|
class DevToolsWebContentsObserver;
|
|
|
|
|
|
|
|
static CefRefPtr<CefBrowserHostImpl> CreateInternal(
|
|
|
|
const CefBrowserSettings& settings,
|
|
|
|
CefRefPtr<CefClient> client,
|
|
|
|
content::WebContents* web_contents,
|
2018-05-18 12:45:18 +02:00
|
|
|
bool own_web_contents,
|
2014-07-08 00:17:33 +02:00
|
|
|
scoped_refptr<CefBrowserInfo> browser_info,
|
2015-11-17 19:20:13 +01:00
|
|
|
CefRefPtr<CefBrowserHostImpl> opener,
|
2016-01-19 21:09:01 +01:00
|
|
|
bool is_devtools_popup,
|
2019-03-24 00:40:32 +01:00
|
|
|
CefRefPtr<CefRequestContextImpl> request_context,
|
2017-08-04 00:55:19 +02:00
|
|
|
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
|
|
|
|
CefRefPtr<CefExtension> extension);
|
2014-07-08 00:17:33 +02:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// content::NotificationObserver methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
void Observe(int type,
|
2017-05-17 11:29:28 +02:00
|
|
|
const content::NotificationSource& source,
|
|
|
|
const content::NotificationDetails& details) override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CefBrowserHostImpl(
|
|
|
|
const CefBrowserSettings& settings,
|
|
|
|
CefRefPtr<CefClient> client,
|
|
|
|
content::WebContents* web_contents,
|
|
|
|
scoped_refptr<CefBrowserInfo> browser_info,
|
|
|
|
CefRefPtr<CefBrowserHostImpl> opener,
|
2019-03-24 00:40:32 +01:00
|
|
|
CefRefPtr<CefRequestContextImpl> request_context,
|
2017-08-04 00:55:19 +02:00
|
|
|
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate,
|
|
|
|
CefRefPtr<CefExtension> extension);
|
2015-11-17 19:20:13 +01:00
|
|
|
|
2018-05-18 12:45:18 +02:00
|
|
|
void set_owned_web_contents(content::WebContents* owned_contents);
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
// Give the platform delegate an opportunity to create the host window.
|
|
|
|
bool CreateHostWindow();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// Create/delete the host for extensions.
|
|
|
|
void CreateExtensionHost(const extensions::Extension* extension,
|
|
|
|
content::BrowserContext* browser_context,
|
|
|
|
content::WebContents* host_contents,
|
|
|
|
const GURL& url,
|
|
|
|
extensions::ViewType host_type);
|
|
|
|
void DestroyExtensionHost();
|
|
|
|
void OnExtensionHostDeleted();
|
|
|
|
|
2018-06-19 00:08:20 +02:00
|
|
|
// Returns true if navigation actions are currently locked.
|
|
|
|
bool navigation_locked() const;
|
|
|
|
// Action to be executed once the navigation lock is released.
|
|
|
|
void set_pending_navigation_action(base::OnceClosure action);
|
|
|
|
|
2019-05-24 22:23:43 +02:00
|
|
|
void OnAddressChange(const GURL& url);
|
2012-04-03 03:34:16 +02:00
|
|
|
void OnLoadStart(CefRefPtr<CefFrame> frame,
|
2014-09-27 01:48:19 +02:00
|
|
|
ui::PageTransition transition_type);
|
2017-05-17 11:29:28 +02:00
|
|
|
void OnLoadError(CefRefPtr<CefFrame> frame, const GURL& url, int error_code);
|
2012-04-03 03:34:16 +02:00
|
|
|
void OnLoadEnd(CefRefPtr<CefFrame> frame,
|
2012-11-21 23:11:22 +01:00
|
|
|
const GURL& url,
|
|
|
|
int http_status_code);
|
2015-06-05 00:33:24 +02:00
|
|
|
void OnFullscreenModeChange(bool fullscreen);
|
2015-08-14 16:41:08 +02:00
|
|
|
void OnTitleChange(const base::string16& title);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2013-11-08 17:06:06 +01:00
|
|
|
void OnDevToolsWebContentsDestroyed();
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
// Create the CefFileDialogManager if it doesn't already exist.
|
|
|
|
void EnsureFileDialogManager();
|
|
|
|
|
2018-04-19 17:44:42 +02:00
|
|
|
void ConfigureAutoResize();
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
CefBrowserSettings settings_;
|
|
|
|
CefRefPtr<CefClient> client_;
|
2012-12-30 12:17:49 +01:00
|
|
|
scoped_refptr<CefBrowserInfo> browser_info_;
|
2012-04-03 03:34:16 +02:00
|
|
|
CefWindowHandle opener_;
|
2019-03-24 00:40:32 +01:00
|
|
|
CefRefPtr<CefRequestContextImpl> request_context_;
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefBrowserPlatformDelegate> platform_delegate_;
|
2016-02-29 21:23:44 +01:00
|
|
|
const bool is_windowless_;
|
2016-01-19 21:09:01 +01:00
|
|
|
const bool is_views_hosted_;
|
|
|
|
CefWindowHandle host_window_handle_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2018-05-18 12:45:18 +02:00
|
|
|
// Non-nullptr if this object owns the WebContents. Will be nullptr for popup
|
|
|
|
// browsers between the calls to WebContentsCreated() and AddNewContents(),
|
|
|
|
// and may never be set if the parent browser is destroyed during popup
|
|
|
|
// creation.
|
|
|
|
std::unique_ptr<content::WebContents> owned_web_contents_;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Volatile state information. All access must be protected by the state lock.
|
|
|
|
base::Lock state_lock_;
|
|
|
|
bool is_loading_;
|
|
|
|
bool can_go_back_;
|
|
|
|
bool can_go_forward_;
|
|
|
|
bool has_document_;
|
2015-06-05 00:33:24 +02:00
|
|
|
bool is_fullscreen_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2019-05-24 22:23:43 +02:00
|
|
|
// The currently focused frame, or nullptr if the main frame is focused.
|
|
|
|
CefRefPtr<CefFrameHostImpl> focused_frame_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2013-03-19 23:59:33 +01:00
|
|
|
// Represents the current browser destruction state. Only accessed on the UI
|
|
|
|
// thread.
|
|
|
|
DestructionState destruction_state_;
|
|
|
|
|
2018-06-19 00:08:20 +02:00
|
|
|
// Navigation will not occur while |navigation_lock_count_| > 0.
|
|
|
|
// |pending_navigation_action_| will be executed when the lock is released.
|
|
|
|
// Only accessed on the UI thread.
|
|
|
|
int navigation_lock_count_ = 0;
|
|
|
|
base::OnceClosure pending_navigation_action_;
|
2015-07-24 02:06:56 +02:00
|
|
|
|
2013-03-19 23:59:33 +01:00
|
|
|
// True if the OS window hosting the browser has been destroyed. Only accessed
|
|
|
|
// on the UI thread.
|
|
|
|
bool window_destroyed_;
|
|
|
|
|
2012-06-11 17:52:49 +02:00
|
|
|
// True if currently in the OnSetFocus callback. Only accessed on the UI
|
|
|
|
// thread.
|
|
|
|
bool is_in_onsetfocus_;
|
|
|
|
|
|
|
|
// True if the focus is currently on an editable field on the page. Only
|
|
|
|
// accessed on the UI thread.
|
|
|
|
bool focus_on_editable_field_;
|
|
|
|
|
2013-04-05 19:05:37 +02:00
|
|
|
// True if mouse cursor change is disabled.
|
|
|
|
bool mouse_cursor_change_disabled_;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Used for managing notification subscriptions.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<content::NotificationRegistrar> registrar_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
// Used for creating and managing file dialogs.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefFileDialogManager> file_dialog_manager_;
|
2015-11-17 19:20:13 +01:00
|
|
|
|
2012-04-16 23:15:27 +02:00
|
|
|
// Used for creating and managing JavaScript dialogs.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefJavaScriptDialogManager> javascript_dialog_manager_;
|
2012-04-16 23:15:27 +02:00
|
|
|
|
2012-04-19 22:31:46 +02:00
|
|
|
// Used for creating and managing context menus.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefMenuManager> menu_manager_;
|
2012-04-19 22:31:46 +02:00
|
|
|
|
2013-11-08 17:06:06 +01:00
|
|
|
// Track the lifespan of the frontend WebContents associated with this
|
|
|
|
// browser.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<DevToolsWebContentsObserver> devtools_observer_;
|
2013-11-08 17:06:06 +01:00
|
|
|
// CefDevToolsFrontend will delete itself when the frontend WebContents is
|
|
|
|
// destroyed.
|
|
|
|
CefDevToolsFrontend* devtools_frontend_;
|
|
|
|
|
2016-02-12 23:31:22 +01:00
|
|
|
// Observers that want to be notified of changes to this object.
|
2018-09-04 11:43:21 +02:00
|
|
|
base::ObserverList<Observer>::Unchecked observers_;
|
2016-02-12 23:31:22 +01:00
|
|
|
|
2017-05-05 21:34:20 +02:00
|
|
|
// Used to provide unique incremental IDs for each find request.
|
|
|
|
int find_request_id_counter_ = 0;
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// Used when the browser is hosting an extension.
|
|
|
|
extensions::ExtensionHost* extension_host_ = nullptr;
|
|
|
|
CefRefPtr<CefExtension> extension_;
|
|
|
|
bool is_background_host_ = false;
|
|
|
|
|
2018-04-19 17:44:42 +02:00
|
|
|
// Used with auto-resize.
|
|
|
|
bool auto_resize_enabled_ = false;
|
|
|
|
gfx::Size auto_resize_min_;
|
|
|
|
gfx::Size auto_resize_max_;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
IMPLEMENT_REFCOUNTING(CefBrowserHostImpl);
|
2015-11-17 19:20:13 +01:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefBrowserHostImpl);
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_BROWSER_HOST_IMPL_H_
|