mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-13 01:56:20 +01:00
7d006a8dd6
- Add HTML5 drag&drop support (issue #140). - Client application must now provide NSApplication implementing CefAppProtocol and call CefRunMessageLoop() (issue #248). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@269 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
38 lines
1.5 KiB
Objective-C
38 lines
1.5 KiB
Objective-C
// 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 _WEB_DRAG_UTILS_MAC
|
|
#define _WEB_DRAG_UTILS_MAC
|
|
#pragma once
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#include "base/basictypes.h"
|
|
#include "googleurl/src/gurl.h"
|
|
|
|
namespace drag_util {
|
|
|
|
// Populates the |url| and |title| with URL data in |pboard|. There may be more
|
|
// than one, but we only handle dropping the first. |url| must not be |NULL|;
|
|
// |title| is an optional parameter. Returns |YES| if URL data was obtained from
|
|
// the pasteboard, |NO| otherwise. If |convert_filenames| is |YES|, the function
|
|
// will also attempt to convert filenames in |pboard| to file URLs.
|
|
BOOL PopulateURLAndTitleFromPasteBoard(GURL* url,
|
|
string16* title,
|
|
NSPasteboard* pboard,
|
|
BOOL convert_filenames);
|
|
|
|
// Returns the first file URL from |info|, if there is one. If |info| doesn't
|
|
// contain any file URLs, an empty |GURL| is returned.
|
|
GURL GetFileURLFromDropData(id<NSDraggingInfo> info);
|
|
|
|
// Determines whether the given drag and drop operation contains content that
|
|
// is supported by the web view. In particular, if the content is a local file
|
|
// URL, this checks if it is of a type that can be shown in the tab contents.
|
|
BOOL IsUnsupportedDropData(id<NSDraggingInfo> info);
|
|
|
|
} // namespace drag_util
|
|
|
|
#endif // _WEB_DRAG_UTILS_MAC
|