2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework 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_RENDERER_FRAME_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_RENDERER_FRAME_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "include/cef_frame.h"
|
|
|
|
#include "include/cef_v8.h"
|
|
|
|
|
|
|
|
class CefBrowserImpl;
|
|
|
|
|
2013-11-08 22:28:56 +01:00
|
|
|
namespace blink {
|
2012-04-03 03:34:16 +02:00
|
|
|
class WebFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Implementation of CefFrame. CefFrameImpl objects are owned by the
|
|
|
|
// CefBrowerImpl and will be detached when the browser is notified that the
|
|
|
|
// associated renderer WebFrame will close.
|
|
|
|
class CefFrameImpl : public CefFrame {
|
|
|
|
public:
|
|
|
|
CefFrameImpl(CefBrowserImpl* browser,
|
2013-11-08 22:28:56 +01:00
|
|
|
blink::WebFrame* frame);
|
2014-11-12 20:25:15 +01:00
|
|
|
~CefFrameImpl() override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// CefFrame implementation.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsValid() override;
|
|
|
|
void Undo() override;
|
|
|
|
void Redo() override;
|
|
|
|
void Cut() override;
|
|
|
|
void Copy() override;
|
|
|
|
void Paste() override;
|
|
|
|
void Delete() override;
|
|
|
|
void SelectAll() override;
|
|
|
|
void ViewSource() override;
|
|
|
|
void GetSource(CefRefPtr<CefStringVisitor> visitor) override;
|
|
|
|
void GetText(CefRefPtr<CefStringVisitor> visitor) override;
|
|
|
|
void LoadRequest(CefRefPtr<CefRequest> request) override;
|
|
|
|
void LoadURL(const CefString& url) override;
|
|
|
|
void LoadString(const CefString& string,
|
|
|
|
const CefString& url) override;
|
|
|
|
void ExecuteJavaScript(const CefString& jsCode,
|
|
|
|
const CefString& scriptUrl,
|
|
|
|
int startLine) override;
|
|
|
|
bool IsMain() override;
|
|
|
|
bool IsFocused() override;
|
|
|
|
CefString GetName() override;
|
|
|
|
int64 GetIdentifier() override;
|
|
|
|
CefRefPtr<CefFrame> GetParent() override;
|
|
|
|
CefString GetURL() override;
|
|
|
|
CefRefPtr<CefBrowser> GetBrowser() override;
|
|
|
|
CefRefPtr<CefV8Context> GetV8Context() override;
|
|
|
|
void VisitDOM(CefRefPtr<CefDOMVisitor> visitor) override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
void Detach();
|
|
|
|
|
2013-11-08 22:28:56 +01:00
|
|
|
blink::WebFrame* web_frame() const { return frame_; }
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-07-21 23:21:32 +02:00
|
|
|
private:
|
|
|
|
void ExecuteCommand(const std::string& command);
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
CefBrowserImpl* browser_;
|
2013-11-08 22:28:56 +01:00
|
|
|
blink::WebFrame* frame_;
|
2012-04-03 03:34:16 +02:00
|
|
|
int64 frame_id_;
|
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(CefFrameImpl);
|
2015-12-09 17:10:16 +01:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefFrameImpl);
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_RENDERER_FRAME_IMPL_H_
|