mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefBrowserSettings.load_drops_disabled option for disabling default navigation resulting from drag & drop of URLs (issue #363).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@327 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -170,6 +170,11 @@ typedef struct _cef_browser_settings_t
|
|||||||
///
|
///
|
||||||
bool drag_drop_disabled;
|
bool drag_drop_disabled;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Disable default navigation resulting from drag & drop of URLs.
|
||||||
|
///
|
||||||
|
bool load_drops_disabled;
|
||||||
|
|
||||||
// The below values map to WebPreferences settings.
|
// The below values map to WebPreferences settings.
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@@ -313,6 +313,7 @@ struct CefBrowserSettingsTraits {
|
|||||||
static inline void set(const struct_type* src, struct_type* target, bool copy)
|
static inline void set(const struct_type* src, struct_type* target, bool copy)
|
||||||
{
|
{
|
||||||
target->drag_drop_disabled = src->drag_drop_disabled;
|
target->drag_drop_disabled = src->drag_drop_disabled;
|
||||||
|
target->load_drops_disabled = src->load_drops_disabled;
|
||||||
|
|
||||||
cef_string_set(src->standard_font_family.str,
|
cef_string_set(src->standard_font_family.str,
|
||||||
src->standard_font_family.length, &target->standard_font_family, copy);
|
src->standard_font_family.length, &target->standard_font_family, copy);
|
||||||
|
@@ -441,6 +441,10 @@ void BrowserWebViewDelegate::setToolTipText(
|
|||||||
GetWidgetHost()->SetTooltipText(tooltipStr);
|
GetWidgetHost()->SetTooltipText(tooltipStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BrowserWebViewDelegate::acceptsLoadDrops() {
|
||||||
|
return !browser_->settings().load_drops_disabled;
|
||||||
|
}
|
||||||
|
|
||||||
void BrowserWebViewDelegate::focusNext() {
|
void BrowserWebViewDelegate::focusNext() {
|
||||||
CefRefPtr<CefClient> client = browser_->GetClient();
|
CefRefPtr<CefClient> client = browser_->GetClient();
|
||||||
if (client.get()) {
|
if (client.get()) {
|
||||||
|
@@ -109,7 +109,7 @@ class BrowserWebViewDelegate : public WebKit::WebViewClient,
|
|||||||
WebKit::WebDragOperationsMask mask,
|
WebKit::WebDragOperationsMask mask,
|
||||||
const WebKit::WebImage& image,
|
const WebKit::WebImage& image,
|
||||||
const WebKit::WebPoint& image_offset) OVERRIDE;
|
const WebKit::WebPoint& image_offset) OVERRIDE;
|
||||||
virtual bool acceptsLoadDrops() OVERRIDE { return true; }
|
virtual bool acceptsLoadDrops() OVERRIDE;
|
||||||
virtual void focusNext() OVERRIDE;
|
virtual void focusNext() OVERRIDE;
|
||||||
virtual void focusPrevious() OVERRIDE;
|
virtual void focusPrevious() OVERRIDE;
|
||||||
virtual void focusedNodeChanged(const WebKit::WebNode& node) OVERRIDE;
|
virtual void focusedNodeChanged(const WebKit::WebNode& node) OVERRIDE;
|
||||||
|
Reference in New Issue
Block a user