mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 5fdc0fab (#520840)
- Windows now builds with clang by default.
This commit is contained in:
@@ -95,23 +95,6 @@ void ExecuteExternalProtocol(const GURL& url) {
|
||||
ShellExecuteA(NULL, "open", address.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
WORD KeyStatesToWord() {
|
||||
static const USHORT kHighBitMaskShort = 0x8000;
|
||||
WORD result = 0;
|
||||
|
||||
if (GetKeyState(VK_CONTROL) & kHighBitMaskShort)
|
||||
result |= MK_CONTROL;
|
||||
if (GetKeyState(VK_SHIFT) & kHighBitMaskShort)
|
||||
result |= MK_SHIFT;
|
||||
if (GetKeyState(VK_LBUTTON) & kHighBitMaskShort)
|
||||
result |= MK_LBUTTON;
|
||||
if (GetKeyState(VK_MBUTTON) & kHighBitMaskShort)
|
||||
result |= MK_MBUTTON;
|
||||
if (GetKeyState(VK_RBUTTON) & kHighBitMaskShort)
|
||||
result |= MK_RBUTTON;
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
CefBrowserPlatformDelegateNativeWin::CefBrowserPlatformDelegateNativeWin(
|
||||
@@ -387,8 +370,9 @@ void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent(
|
||||
// TODO(cef): CefKeyEvent does not currently pass extended key status (see
|
||||
// WM_KEYDOWN docs) which would be necessary to pass EF_IS_EXTENDED_KEY as
|
||||
// the |flags| parameter to DomKeyFromKeyboardCode().
|
||||
int flags = 0;
|
||||
result.dom_key = ui::PlatformKeyMap::DomKeyFromKeyboardCode(
|
||||
ui::KeyboardCodeForWindowsKeyCode(key_event.windows_key_code), 0);
|
||||
ui::KeyboardCodeForWindowsKeyCode(key_event.windows_key_code), &flags);
|
||||
}
|
||||
|
||||
if (result.GetType() == blink::WebInputEvent::kChar ||
|
||||
|
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <commdlg.h>
|
||||
#include <shlobj.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
#include "libcef/browser/browser_host_impl.h"
|
||||
|
||||
@@ -15,7 +16,6 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/win/registry.h"
|
||||
#include "base/win/scoped_comptr.h"
|
||||
#include "cef/grit/cef_strings.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "net/base/mime_util.h"
|
||||
@@ -395,7 +395,7 @@ bool RunOpenFolderDialog(const CefFileDialogRunner::FileChooserParams& params,
|
||||
STRRET out_dir_buffer;
|
||||
ZeroMemory(&out_dir_buffer, sizeof(out_dir_buffer));
|
||||
out_dir_buffer.uType = STRRET_WSTR;
|
||||
base::win::ScopedComPtr<IShellFolder> shell_folder;
|
||||
Microsoft::WRL::ComPtr<IShellFolder> shell_folder;
|
||||
if (SHGetDesktopFolder(shell_folder.GetAddressOf()) == NOERROR) {
|
||||
HRESULT hr = shell_folder->GetDisplayNameOf(list, SHGDN_FORPARSING,
|
||||
&out_dir_buffer);
|
||||
|
@@ -11,9 +11,9 @@
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
|
||||
#if __OBJC__
|
||||
@class MenuController;
|
||||
@class MenuControllerCocoa;
|
||||
#else
|
||||
class MenuController;
|
||||
class MenuControllerCocoa;
|
||||
#endif
|
||||
|
||||
class CefMenuRunnerMac : public CefMenuRunner {
|
||||
@@ -28,7 +28,7 @@ class CefMenuRunnerMac : public CefMenuRunner {
|
||||
void CancelContextMenu() override;
|
||||
|
||||
private:
|
||||
base::scoped_nsobject<MenuController> menu_controller_;
|
||||
base::scoped_nsobject<MenuControllerCocoa> menu_controller_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_NATIVE_MENU_RUNNER_MAC_H_
|
||||
|
@@ -21,14 +21,16 @@ bool CefMenuRunnerMac::RunContextMenu(
|
||||
CefMenuModelImpl* model,
|
||||
const content::ContextMenuParams& params) {
|
||||
// Create a menu controller based on the model.
|
||||
menu_controller_.reset([[MenuController alloc] initWithModel:model->model()
|
||||
useWithPopUpButtonCell:NO]);
|
||||
menu_controller_.reset([[MenuControllerCocoa alloc]
|
||||
initWithModel:model->model()
|
||||
useWithPopUpButtonCell:NO]);
|
||||
|
||||
// Keep the menu controller alive (by adding an additional retain) until after
|
||||
// the menu has been dismissed. Otherwise it will crash if the browser is
|
||||
// destroyed (and consequently the menu controller is destroyed) while the
|
||||
// menu is still pending.
|
||||
base::scoped_nsobject<MenuController> menu_controller_ref(menu_controller_);
|
||||
base::scoped_nsobject<MenuControllerCocoa> menu_controller_ref(
|
||||
menu_controller_);
|
||||
|
||||
// Make sure events can be pumped while the menu is up.
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
|
@@ -109,7 +109,7 @@ static CefNativeMenuWin* GetCefNativeMenuWinFromHMENU(HMENU hmenu) {
|
||||
// structure we have constructed in CefNativeMenuWin.
|
||||
class CefNativeMenuWin::MenuHostWindow {
|
||||
public:
|
||||
explicit MenuHostWindow(CefNativeMenuWin* parent) : parent_(parent) {
|
||||
MenuHostWindow() {
|
||||
RegisterClass();
|
||||
hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName,
|
||||
L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL);
|
||||
@@ -389,7 +389,6 @@ class CefNativeMenuWin::MenuHostWindow {
|
||||
}
|
||||
|
||||
HWND hwnd_;
|
||||
CefNativeMenuWin* parent_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MenuHostWindow);
|
||||
};
|
||||
@@ -775,7 +774,7 @@ void CefNativeMenuWin::CreateHostWindow() {
|
||||
// host window per menu hierarchy, no matter how many CefNativeMenuWin objects
|
||||
// exist wrapping submenus.
|
||||
if (!host_window_.get())
|
||||
host_window_.reset(new MenuHostWindow(this));
|
||||
host_window_.reset(new MenuHostWindow());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -38,7 +38,7 @@ const char kXdndProxy[] = "XdndProxy";
|
||||
::Window root;
|
||||
::Window parent;
|
||||
::Window* children;
|
||||
::Window child_window = None;
|
||||
::Window child_window = x11::None;
|
||||
unsigned int nchildren;
|
||||
if (XQueryTree(display, window, &root, &parent, &children, &nchildren)) {
|
||||
DCHECK_EQ(1U, nchildren);
|
||||
@@ -50,8 +50,8 @@ const char kXdndProxy[] = "XdndProxy";
|
||||
|
||||
::Window FindToplevelParent(::Display* display, ::Window window) {
|
||||
::Window top_level_window = window;
|
||||
::Window root = None;
|
||||
::Window parent = None;
|
||||
::Window root = x11::None;
|
||||
::Window parent = x11::None;
|
||||
::Window* children = NULL;
|
||||
unsigned int nchildren = 0;
|
||||
// Enumerate all parents of "window" to find the highest level window
|
||||
@@ -91,12 +91,12 @@ CefWindowX11::CefWindowX11(CefRefPtr<CefBrowserHostImpl> browser,
|
||||
bounds_(bounds),
|
||||
focus_pending_(false),
|
||||
weak_ptr_factory_(this) {
|
||||
if (parent_xwindow_ == None)
|
||||
if (parent_xwindow_ == x11::None)
|
||||
parent_xwindow_ = DefaultRootWindow(xdisplay_);
|
||||
|
||||
XSetWindowAttributes swa;
|
||||
memset(&swa, 0, sizeof(swa));
|
||||
swa.background_pixmap = None;
|
||||
swa.background_pixmap = x11::None;
|
||||
swa.override_redirect = false;
|
||||
xwindow_ = XCreateWindow(xdisplay_, parent_xwindow_, bounds.x(), bounds.y(),
|
||||
bounds.width(), bounds.height(),
|
||||
@@ -148,12 +148,12 @@ void CefWindowX11::Close() {
|
||||
ev.xclient.message_type = gfx::GetAtom(kWMProtocols);
|
||||
ev.xclient.format = 32;
|
||||
ev.xclient.data.l[0] = gfx::GetAtom(kWMDeleteWindow);
|
||||
ev.xclient.data.l[1] = CurrentTime;
|
||||
XSendEvent(xdisplay_, xwindow_, False, NoEventMask, &ev);
|
||||
ev.xclient.data.l[1] = x11::CurrentTime;
|
||||
XSendEvent(xdisplay_, xwindow_, false, NoEventMask, &ev);
|
||||
}
|
||||
|
||||
void CefWindowX11::Show() {
|
||||
if (xwindow_ == None)
|
||||
if (xwindow_ == x11::None)
|
||||
return;
|
||||
|
||||
if (!window_mapped_) {
|
||||
@@ -205,7 +205,7 @@ void CefWindowX11::Show() {
|
||||
}
|
||||
|
||||
void CefWindowX11::Hide() {
|
||||
if (xwindow_ == None)
|
||||
if (xwindow_ == x11::None)
|
||||
return;
|
||||
|
||||
if (window_mapped_) {
|
||||
@@ -215,22 +215,22 @@ void CefWindowX11::Hide() {
|
||||
}
|
||||
|
||||
void CefWindowX11::Focus() {
|
||||
if (xwindow_ == None || !window_mapped_)
|
||||
if (xwindow_ == x11::None || !window_mapped_)
|
||||
return;
|
||||
|
||||
if (browser_.get()) {
|
||||
::Window child = FindChild(xdisplay_, xwindow_);
|
||||
if (child && ui::IsWindowVisible(child)) {
|
||||
// Give focus to the child DesktopWindowTreeHostX11.
|
||||
XSetInputFocus(xdisplay_, child, RevertToParent, CurrentTime);
|
||||
XSetInputFocus(xdisplay_, child, RevertToParent, x11::CurrentTime);
|
||||
}
|
||||
} else {
|
||||
XSetInputFocus(xdisplay_, xwindow_, RevertToParent, CurrentTime);
|
||||
XSetInputFocus(xdisplay_, xwindow_, RevertToParent, x11::CurrentTime);
|
||||
}
|
||||
}
|
||||
|
||||
void CefWindowX11::SetBounds(const gfx::Rect& bounds) {
|
||||
if (xwindow_ == None)
|
||||
if (xwindow_ == x11::None)
|
||||
return;
|
||||
|
||||
bool origin_changed = bounds_.origin() != bounds.origin();
|
||||
@@ -315,7 +315,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
|
||||
// Allow the close.
|
||||
XDestroyWindow(xdisplay_, xwindow_);
|
||||
|
||||
xwindow_ = None;
|
||||
xwindow_ = x11::None;
|
||||
|
||||
if (browser_.get()) {
|
||||
// Force the browser to be destroyed and release the reference
|
||||
@@ -329,7 +329,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
|
||||
XEvent reply_event = *xev;
|
||||
reply_event.xclient.window = parent_xwindow_;
|
||||
|
||||
XSendEvent(xdisplay_, reply_event.xclient.window, False,
|
||||
XSendEvent(xdisplay_, reply_event.xclient.window, false,
|
||||
SubstructureRedirectMask | SubstructureNotifyMask,
|
||||
&reply_event);
|
||||
XFlush(xdisplay_);
|
||||
|
Reference in New Issue
Block a user