#include "third_party/blink/renderer/core/editing/commands/clipboard_commands.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "third_party/blink/renderer/core/clipboard/clipboard_utilities.h"
#include "third_party/blink/renderer/core/clipboard/data_transfer_access_policy.h"
#include "third_party/blink/renderer/core/clipboard/paste_mode.h"
#include "third_party/blink/renderer/core/clipboard/system_clipboard.h"
#include "third_party/blink/renderer/core/editing/commands/editing_commands_utilities.h"
#include "third_party/blink/renderer/core/editing/editing_behavior.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/editor.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/ime/input_method_controller.h"
#include "third_party/blink/renderer/core/editing/serializers/serialization.h"
#include "third_party/blink/renderer/core/events/clipboard_event.h"
#include "third_party/blink/renderer/core/events/text_event.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/loader/resource/image_resource_content.h"
#include "third_party/blink/renderer/core/loader/resource/image_resource_observer.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_parameters.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_request.h"
namespace blink {
namespace {
class ExecutionContextClipboardEventState
: public GarbageCollected<ExecutionContextClipboardEventState>,
public Supplement<ExecutionContext> { … };
}
bool ClipboardCommands::CanReadClipboard(LocalFrame& frame,
EditorCommandSource source) { … }
bool ClipboardCommands::CanWriteClipboard(LocalFrame& frame,
EditorCommandSource source) { … }
bool ClipboardCommands::IsExecutingCutOrCopy(ExecutionContext& context) { … }
bool ClipboardCommands::IsExecutingPaste(ExecutionContext& context) { … }
bool ClipboardCommands::CanSmartReplaceInClipboard(LocalFrame& frame) { … }
Element* ClipboardCommands::FindEventTargetForClipboardEvent(
LocalFrame& frame,
EditorCommandSource source) { … }
bool ClipboardCommands::DispatchClipboardEvent(LocalFrame& frame,
const AtomicString& event_type,
DataTransferAccessPolicy policy,
EditorCommandSource source,
PasteMode paste_mode) { … }
bool ClipboardCommands::DispatchCopyOrCutEvent(LocalFrame& frame,
EditorCommandSource source,
const AtomicString& event_type) { … }
bool ClipboardCommands::DispatchPasteEvent(LocalFrame& frame,
PasteMode paste_mode,
EditorCommandSource source) { … }
bool ClipboardCommands::EnabledCopy(LocalFrame& frame,
Event*,
EditorCommandSource source) { … }
bool ClipboardCommands::EnabledCut(LocalFrame& frame,
Event*,
EditorCommandSource source) { … }
bool ClipboardCommands::EnabledPaste(LocalFrame& frame,
Event*,
EditorCommandSource source) { … }
static SystemClipboard::SmartReplaceOption GetSmartReplaceOption(
const LocalFrame& frame) { … }
void ClipboardCommands::WriteSelectionToClipboard(LocalFrame& frame) { … }
bool ClipboardCommands::PasteSupported(LocalFrame* frame) { … }
bool ClipboardCommands::ExecuteCopy(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String&) { … }
bool ClipboardCommands::CanDeleteRange(const EphemeralRange& range) { … }
static DeleteMode ConvertSmartReplaceOptionToDeleteMode(
SystemClipboard::SmartReplaceOption smart_replace_option) { … }
bool ClipboardCommands::ExecuteCut(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String&) { … }
void ClipboardCommands::PasteAsFragment(LocalFrame& frame,
DocumentFragment* pasting_fragment,
bool smart_replace,
bool match_style,
EditorCommandSource source) { … }
void ClipboardCommands::PasteAsPlainTextFromClipboard(
LocalFrame& frame,
EditorCommandSource source) { … }
ClipboardCommands::FragmentAndPlainText
ClipboardCommands::GetFragmentFromClipboard(LocalFrame& frame) { … }
void ClipboardCommands::PasteFromClipboard(LocalFrame& frame,
EditorCommandSource source) { … }
void ClipboardCommands::Paste(LocalFrame& frame, EditorCommandSource source) { … }
class CORE_EXPORT PasteImageResourceObserver final
: public GarbageCollected<PasteImageResourceObserver>,
public ImageResourceObserver { … };
void ClipboardCommands::PasteFromImageURL(LocalFrame& frame,
EditorCommandSource source,
const String src) { … }
bool ClipboardCommands::ExecutePaste(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String&) { … }
bool ClipboardCommands::ExecutePasteGlobalSelection(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String&) { … }
bool ClipboardCommands::ExecutePasteAndMatchStyle(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String&) { … }
bool ClipboardCommands::ExecutePasteFromImageURL(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String& src) { … }
}