Windows: Fix assignment of keyboard focus (issue #1248).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1643 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2014-04-04 22:26:39 +00:00
parent 199a3faafe
commit d8aed5b52d
4 changed files with 45 additions and 0 deletions

View File

@@ -32,12 +32,14 @@
#include "net/base/mime_util.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/win/WebInputEventFactory.h"
#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/win/shell.h"
#include "ui/gfx/win/hwnd_util.h"
#include "ui/views/background.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -62,6 +64,21 @@ void SetAeroGlass(HWND hWnd) {
DwmExtendFrameIntoClientArea(hWnd, &mgMarInset);
}
HWND GetHWND(views::Widget* widget) {
gfx::NativeWindow window = widget->GetNativeWindow();
DCHECK(window);
if (!window)
return NULL;
views::DesktopWindowTreeHostWin* host =
static_cast<views::DesktopWindowTreeHostWin*>(window->GetHost());
DCHECK(host);
if (!host)
return NULL;
HWND hwnd = host->GetHWND();
DCHECK(hwnd);
return hwnd;
}
void WriteTempFileAndView(scoped_refptr<base::RefCountedString> str) {
CEF_REQUIRE_FILET();
@@ -709,6 +726,11 @@ LRESULT CALLBACK CefBrowserHostImpl::WndProc(HWND hwnd, UINT message,
return DefWindowProc(hwnd, message, wParam, lParam);
}
void CefBrowserHostImpl::PlatformSetViewFocus() {
if (window_widget_)
::SetFocus(GetHWND(window_widget_));
}
ui::PlatformCursor CefBrowserHostImpl::GetPlatformCursor(
blink::WebCursorInfo::Type type) {
HMODULE module_handle = NULL;