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 <queue>
|
|
|
|
#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"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef/common/response_manager.h"
|
|
|
|
|
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
|
|
|
|
|
2012-04-04 20:18:09 +02:00
|
|
|
namespace net {
|
|
|
|
class URLRequest;
|
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-01-19 21:09:01 +01:00
|
|
|
#if defined(USE_AURA)
|
|
|
|
namespace views {
|
|
|
|
class Widget;
|
|
|
|
}
|
|
|
|
#endif // defined(USE_AURA)
|
|
|
|
|
2015-04-24 15:48:32 +02:00
|
|
|
struct Cef_DraggableRegion_Params;
|
2012-04-03 03:34:16 +02:00
|
|
|
struct Cef_Request_Params;
|
|
|
|
struct Cef_Response_Params;
|
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;
|
2014-07-16 23:27:25 +02:00
|
|
|
struct CefNavigateParams;
|
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
|
|
|
|
|
|
|
// 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);
|
2012-04-03 03:34:16 +02:00
|
|
|
// Returns the browser associated with the specified URLRequest.
|
|
|
|
static CefRefPtr<CefBrowserHostImpl> GetBrowserForRequest(
|
2015-07-16 23:40:01 +02:00
|
|
|
const net::URLRequest* request);
|
2014-01-02 23:41:11 +01:00
|
|
|
// Returns the browser associated with the specified view routing IDs.
|
2017-05-17 11:29:28 +02:00
|
|
|
static CefRefPtr<CefBrowserHostImpl> GetBrowserForView(int render_process_id,
|
|
|
|
int render_routing_id);
|
2014-01-02 23:41:11 +01:00
|
|
|
// Returns the browser associated with the specified frame routing IDs.
|
|
|
|
static CefRefPtr<CefBrowserHostImpl> GetBrowserForFrame(
|
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;
|
|
|
|
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;
|
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;
|
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;
|
2017-05-17 11:29:28 +02:00
|
|
|
bool SendProcessMessage(CefProcessId target_process,
|
|
|
|
CefRefPtr<CefProcessMessage> message) 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;
|
|
|
|
|
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
|
|
|
|
|
|
|
// Returns the frame associated with the specified URLRequest.
|
|
|
|
CefRefPtr<CefFrame> GetFrameForRequest(net::URLRequest* request);
|
|
|
|
|
|
|
|
// Navigate as specified by the |params| argument.
|
2014-07-16 23:27:25 +02:00
|
|
|
void Navigate(const CefNavigateParams& params);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Load the specified request.
|
|
|
|
void LoadRequest(int64 frame_id, CefRefPtr<CefRequest> request);
|
|
|
|
|
|
|
|
// Load the specified URL.
|
2014-07-16 23:27:25 +02:00
|
|
|
void LoadURL(int64 frame_id,
|
|
|
|
const std::string& url,
|
|
|
|
const content::Referrer& referrer,
|
2014-09-27 01:48:19 +02:00
|
|
|
ui::PageTransition transition,
|
2014-07-16 23:27:25 +02:00
|
|
|
const std::string& extra_headers);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Load the specified string.
|
2017-05-17 11:29:28 +02:00
|
|
|
void LoadString(int64 frame_id,
|
|
|
|
const std::string& string,
|
2012-10-18 00:45:49 +02:00
|
|
|
const std::string& url);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Send a command to the renderer for execution.
|
2017-05-17 11:29:28 +02:00
|
|
|
void SendCommand(int64 frame_id,
|
|
|
|
const std::string& command,
|
2012-04-03 03:34:16 +02:00
|
|
|
CefRefPtr<CefResponseManager::Handler> responseHandler);
|
|
|
|
|
|
|
|
// Send code to the renderer for execution.
|
2017-05-17 11:29:28 +02:00
|
|
|
void SendCode(int64 frame_id,
|
|
|
|
bool is_javascript,
|
|
|
|
const std::string& code,
|
|
|
|
const std::string& script_url,
|
|
|
|
int script_start_line,
|
2012-04-03 03:34:16 +02:00
|
|
|
CefRefPtr<CefResponseManager::Handler> responseHandler);
|
|
|
|
|
2017-05-31 17:33:30 +02:00
|
|
|
void ExecuteJavaScriptWithUserGestureForTests(int64 frame_id,
|
|
|
|
const CefString& javascript);
|
|
|
|
|
2012-10-18 00:45:49 +02:00
|
|
|
bool SendProcessMessage(CefProcessId target_process,
|
|
|
|
const std::string& name,
|
|
|
|
base::ListValue* arguments,
|
|
|
|
bool user_initiated);
|
|
|
|
|
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
|
|
|
|
2012-06-25 23:21:27 +02:00
|
|
|
// Handler for URLs involving external protocols.
|
|
|
|
void HandleExternalProtocol(const GURL& url);
|
|
|
|
|
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;
|
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.
|
2015-11-17 19:20:13 +01:00
|
|
|
void RunFileChooser(
|
|
|
|
const CefFileDialogRunner::FileChooserParams& params,
|
|
|
|
const 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.
|
|
|
|
content::WebContents* GetActionableWebContents();
|
|
|
|
|
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,
|
|
|
|
content::WebContents* new_contents,
|
|
|
|
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;
|
|
|
|
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,
|
|
|
|
int32_t level,
|
|
|
|
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;
|
|
|
|
bool HandleContextMenu(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;
|
2014-11-12 20:25:15 +01:00
|
|
|
void 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,
|
|
|
|
const content::FileChooserParams& params) override;
|
2015-06-11 17:00:05 +02:00
|
|
|
bool EmbedsFullscreenWidget() const override;
|
2015-06-05 00:33:24 +02:00
|
|
|
void EnterFullscreenModeForTab(content::WebContents* web_contents,
|
|
|
|
const GURL& origin) override;
|
|
|
|
void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
|
|
|
|
bool IsFullscreenForTabOrPending(
|
|
|
|
const content::WebContents* web_contents) const override;
|
|
|
|
blink::WebDisplayMode GetDisplayMode(
|
|
|
|
const content::WebContents* web_contents) const 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,
|
2014-11-12 20:25:15 +01:00
|
|
|
const content::MediaResponseCallback& callback) override;
|
2015-03-25 22:22:47 +01:00
|
|
|
bool CheckMediaAccessPermission(content::WebContents* web_contents,
|
|
|
|
const GURL& security_origin,
|
|
|
|
content::MediaStreamType type) override;
|
2017-08-04 00:55:19 +02:00
|
|
|
bool IsNeverVisible(content::WebContents* web_contents) override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// content::WebContentsObserver methods.
|
2013-07-19 01:25:28 +02:00
|
|
|
using content::WebContentsObserver::BeforeUnloadFired;
|
2013-10-17 17:13:25 +02:00
|
|
|
using content::WebContentsObserver::WasHidden;
|
2017-03-03 23:37:23 +01:00
|
|
|
void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
|
|
|
|
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
|
|
|
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;
|
2014-11-12 20:25:15 +01:00
|
|
|
void DocumentAvailableInMainFrame() override;
|
|
|
|
void DidFailLoad(content::RenderFrameHost* render_frame_host,
|
|
|
|
const GURL& validated_url,
|
|
|
|
int error_code,
|
2017-09-06 23:40:58 +02:00
|
|
|
const base::string16& error_description) override;
|
2017-03-03 23:37:23 +01:00
|
|
|
void FrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
2015-08-14 16:41:08 +02:00
|
|
|
void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) 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;
|
2017-05-12 20:28:25 +02:00
|
|
|
void AccessibilityEventReceived(
|
|
|
|
const std::vector<content::AXEventNotificationDetails>& eventData)
|
|
|
|
override;
|
|
|
|
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;
|
2012-04-03 03:34:16 +02:00
|
|
|
// Override to provide a thread safe implementation.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool Send(IPC::Message* message) override;
|
2012-04-03 03:34:16 +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;
|
|
|
|
|
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,
|
|
|
|
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,
|
2015-11-17 19:20:13 +01:00
|
|
|
CefRefPtr<CefRequestContext> 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::WebContentsObserver::OnMessageReceived() message handlers.
|
2013-12-17 23:04:35 +01:00
|
|
|
void OnFrameIdentified(int64 frame_id,
|
|
|
|
int64 parent_frame_id,
|
|
|
|
base::string16 name);
|
2017-05-31 17:33:30 +02:00
|
|
|
void OnFrameFocused(content::RenderFrameHost* render_frame_host);
|
2017-05-17 11:29:28 +02:00
|
|
|
void OnDidFinishLoad(int64 frame_id,
|
|
|
|
const GURL& validated_url,
|
|
|
|
bool is_main_frame,
|
|
|
|
int http_status_code);
|
2015-04-24 15:48:32 +02:00
|
|
|
void OnUpdateDraggableRegions(
|
|
|
|
const std::vector<Cef_DraggableRegion_Params>& regions);
|
2012-04-03 03:34:16 +02:00
|
|
|
void OnRequest(const Cef_Request_Params& params);
|
|
|
|
void OnResponse(const Cef_Response_Params& params);
|
|
|
|
void OnResponseAck(int request_id);
|
|
|
|
|
|
|
|
// 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,
|
|
|
|
CefRefPtr<CefRequestContext> 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
|
|
|
|
|
|
|
// 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();
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Updates and returns an existing frame or creates a new frame. Pass
|
|
|
|
// CefFrameHostImpl::kUnspecifiedFrameId for |parent_frame_id| if unknown.
|
|
|
|
CefRefPtr<CefFrame> GetOrCreateFrame(int64 frame_id,
|
|
|
|
int64 parent_frame_id,
|
|
|
|
bool is_main_frame,
|
2013-12-17 23:04:35 +01:00
|
|
|
base::string16 frame_name,
|
2012-04-03 03:34:16 +02:00
|
|
|
const GURL& frame_url);
|
|
|
|
// Remove the references to all frames and mark them as detached.
|
|
|
|
void DetachAllFrames();
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void OnAddressChange(CefRefPtr<CefFrame> frame, 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();
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
CefBrowserSettings settings_;
|
|
|
|
CefRefPtr<CefClient> client_;
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<content::WebContents> web_contents_;
|
2012-12-30 12:17:49 +01:00
|
|
|
scoped_refptr<CefBrowserInfo> browser_info_;
|
2012-04-03 03:34:16 +02:00
|
|
|
CefWindowHandle opener_;
|
2013-09-03 18:43:31 +02:00
|
|
|
CefRefPtr<CefRequestContext> 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
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
// Messages we queue while waiting for the RenderView to be ready. We queue
|
|
|
|
// them here instead of in the RenderProcessHost to ensure that they're sent
|
|
|
|
// after the CefRenderViewObserver has been created on the renderer side.
|
|
|
|
std::queue<IPC::Message*> queued_messages_;
|
|
|
|
bool queue_messages_;
|
|
|
|
|
|
|
|
// Map of unique frame ids to CefFrameHostImpl references.
|
2017-05-17 11:29:28 +02:00
|
|
|
typedef std::map<int64, CefRefPtr<CefFrameHostImpl>> FrameMap;
|
2012-04-03 03:34:16 +02:00
|
|
|
FrameMap frames_;
|
|
|
|
// The unique frame id currently identified as the main frame.
|
|
|
|
int64 main_frame_id_;
|
|
|
|
// The unique frame id currently identified as the focused frame.
|
|
|
|
int64 focused_frame_id_;
|
|
|
|
// Used when no other frame exists. Provides limited functionality.
|
|
|
|
CefRefPtr<CefFrameHostImpl> placeholder_frame_;
|
|
|
|
|
2013-03-19 23:59:33 +01:00
|
|
|
// Represents the current browser destruction state. Only accessed on the UI
|
|
|
|
// thread.
|
|
|
|
DestructionState destruction_state_;
|
|
|
|
|
2015-07-24 02:06:56 +02:00
|
|
|
// True if frame destruction is currently pending. Navigation should not occur
|
|
|
|
// while this flag is true.
|
|
|
|
bool frame_destruction_pending_;
|
|
|
|
|
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
|
|
|
|
2012-05-18 23:18:01 +02:00
|
|
|
// Manages response registrations.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefResponseManager> response_manager_;
|
2012-05-18 23:18:01 +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.
|
|
|
|
base::ObserverList<Observer> observers_;
|
|
|
|
|
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;
|
|
|
|
|
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_
|