cef/libcef/browser_drop_delegate.cc
Marshall Greenblatt 0a98edff56 libcef:
- Fix ASSERT in CefBrowserImpl::UIT_GetPagesCount() when no default printer is configured (Issue #20).
- Remove non-existent WebFrame objects while iterating over the bound object list in CefJSContainer::BindToJavascript().  WebFrame objects are destroyed when navigating from a page with more frames to a page with less frames.  If we don't remove the non-existent frames they will remain in the list until the browser window is destroyed.
- Don't call UIT_* functions from class destructors as destruction may occur on a different thread.

libcef: Update due to underlying chromium changes.
- Header file locations changed from third_party/WebKit/WebKit to webkit/api as a result of WebKit unforking.
- Project file locations changed due to GYP now being used for WebKit builds.
- Add simple_clipboard_impl.cc in the libcef directory because it has been moved from webkit/glue to test_shell.
- Changes related to navigation.
- New parameters added to WebViewDelegate methods.

libcef_dll: Update due to underlying chromium changes.
- webkit_resources.rc and webkit_strings_en-US.rc moved from grit_derived_sources to obj/global_intermediate/webkit.


git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@24 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2009-05-15 15:09:51 +00:00

64 lines
2.3 KiB
C++

// Copyright (c) 2008 The Chromium Embedded Framework Authors.
// Portions copyright (c) 2006-2008 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.
#include "precompiled_libcef.h"
#include "browser_drop_delegate.h"
#include "webkit/api/public/WebDragData.h"
#include "webkit/api/public/WebPoint.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webview.h"
using WebKit::WebPoint;
// BaseDropTarget methods ----------------------------------------------------
DWORD BrowserDropDelegate::OnDragEnter(IDataObject* data_object,
DWORD key_state,
POINT cursor_position,
DWORD effect) {
WebDropData drop_data;
WebDropData::PopulateWebDropData(data_object, &drop_data);
POINT client_pt = cursor_position;
ScreenToClient(GetHWND(), &client_pt);
bool valid = webview_->DragTargetDragEnter(
drop_data.ToDragData(), drop_data.identity,
WebPoint(client_pt.x, client_pt.y),
WebPoint(cursor_position.x, cursor_position.y));
return valid ? DROPEFFECT_COPY : DROPEFFECT_NONE;
}
DWORD BrowserDropDelegate::OnDragOver(IDataObject* data_object,
DWORD key_state,
POINT cursor_position,
DWORD effect) {
POINT client_pt = cursor_position;
ScreenToClient(GetHWND(), &client_pt);
bool valid = webview_->DragTargetDragOver(
WebPoint(client_pt.x, client_pt.y),
WebPoint(cursor_position.x, cursor_position.y));
return valid ? DROPEFFECT_COPY : DROPEFFECT_NONE;
}
void BrowserDropDelegate::OnDragLeave(IDataObject* data_object) {
webview_->DragTargetDragLeave();
}
DWORD BrowserDropDelegate::OnDrop(IDataObject* data_object,
DWORD key_state,
POINT cursor_position,
DWORD effect) {
POINT client_pt = cursor_position;
ScreenToClient(GetHWND(), &client_pt);
webview_->DragTargetDrop(
WebPoint(client_pt.x, client_pt.y),
WebPoint(cursor_position.x, cursor_position.y));
// webkit win port always returns DROPEFFECT_NONE
return DROPEFFECT_NONE;
}