diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-08 14:30:41 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-12 13:49:54 +0200 |
commit | ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 (patch) | |
tree | 498dfb8a97ff3361a9f7486863a52bb4e26bb898 /chromium/ui/base/win | |
parent | 4ce69f7403811819800e7c5ae1318b2647e778d1 (diff) | |
download | qtwebengine-chromium-ab0a50979b9eb4dfa3320eff7e187e41efedf7a9.tar.gz |
Update Chromium to beta version 37.0.2062.68
Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/ui/base/win')
23 files changed, 239 insertions, 100 deletions
diff --git a/chromium/ui/base/win/accessibility_misc_utils.cc b/chromium/ui/base/win/accessibility_misc_utils.cc index 5074ce372a7..621048ffcd8 100644 --- a/chromium/ui/base/win/accessibility_misc_utils.cc +++ b/chromium/ui/base/win/accessibility_misc_utils.cc @@ -14,7 +14,9 @@ UIATextProvider::UIATextProvider() : editable_(false) {} // static -bool UIATextProvider::CreateTextProvider(bool editable, IUnknown** provider) { +bool UIATextProvider::CreateTextProvider(const string16& value, + bool editable, + IUnknown** provider) { // Make sure ATL is initialized in this module. ui::win::CreateATLModuleIfNeeded(); @@ -23,6 +25,7 @@ bool UIATextProvider::CreateTextProvider(bool editable, IUnknown** provider) { if (SUCCEEDED(hr)) { DCHECK(text_provider); text_provider->set_editable(editable); + text_provider->set_value(value); text_provider->AddRef(); *provider = static_cast<ITextProvider*>(text_provider); return true; @@ -35,5 +38,10 @@ STDMETHODIMP UIATextProvider::get_IsReadOnly(BOOL* read_only) { return S_OK; } +STDMETHODIMP UIATextProvider::get_Value(BSTR* value) { + *value = SysAllocString(value_.c_str()); + return S_OK; +} + } // namespace win } // namespace base diff --git a/chromium/ui/base/win/accessibility_misc_utils.h b/chromium/ui/base/win/accessibility_misc_utils.h index 3789efb02b5..e17f1d3c6b0 100644 --- a/chromium/ui/base/win/accessibility_misc_utils.h +++ b/chromium/ui/base/win/accessibility_misc_utils.h @@ -9,13 +9,14 @@ #include <UIAutomationCore.h> #include "base/compiler_specific.h" -#include "ui/base/ui_export.h" +#include "base/strings/string16.h" +#include "ui/base/ui_base_export.h" namespace base { namespace win { // UIA Text provider implementation for edit controls. -class UI_EXPORT UIATextProvider +class UI_BASE_EXPORT UIATextProvider : public NON_EXPORTED_BASE(CComObjectRootEx<CComMultiThreadModel>), public IValueProvider, public ITextProvider { @@ -30,12 +31,16 @@ class UI_EXPORT UIATextProvider // Creates an instance of the UIATextProvider class. // Returns true on success - static bool CreateTextProvider(bool editable, IUnknown** provider); + static bool CreateTextProvider(const string16& value, + bool editable, + IUnknown** provider); void set_editable(bool editable) { editable_ = editable; } + void set_value(const string16& value) { value_ = value; } + // // IValueProvider methods. // @@ -48,9 +53,7 @@ class UI_EXPORT UIATextProvider return E_NOTIMPL; } - STDMETHOD(get_Value)(BSTR* value) { - return E_NOTIMPL; - } + STDMETHOD(get_Value)(BSTR* value); // // ITextProvider methods. @@ -83,6 +86,7 @@ class UI_EXPORT UIATextProvider private: bool editable_; + string16 value_; }; } // win diff --git a/chromium/ui/base/win/dpi_setup.cc b/chromium/ui/base/win/dpi_setup.cc index ad4e6e8616e..423b788132a 100644 --- a/chromium/ui/base/win/dpi_setup.cc +++ b/chromium/ui/base/win/dpi_setup.cc @@ -4,6 +4,7 @@ #include "ui/base/win/dpi_setup.h" +#include "base/command_line.h" #include "ui/base/layout.h" #include "ui/gfx/display.h" #include "ui/gfx/win/dpi.h" diff --git a/chromium/ui/base/win/dpi_setup.h b/chromium/ui/base/win/dpi_setup.h index a88584996f0..5837153d9fd 100644 --- a/chromium/ui/base/win/dpi_setup.h +++ b/chromium/ui/base/win/dpi_setup.h @@ -5,7 +5,7 @@ #ifndef UI_BASE_WIN_DPI_SETUP_H_ #define UI_BASE_WIN_DPI_SETUP_H_ -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" namespace ui { namespace win { @@ -14,7 +14,7 @@ namespace win { // the best available scale based on the screen's pixel density. This can be // affected (overridden) by --force-device-scale-factor=x // This function can be called only once for the lifetime of a process. -UI_EXPORT void InitDeviceScaleFactor(); +UI_BASE_EXPORT void InitDeviceScaleFactor(); } // namespace win } // namespace ui diff --git a/chromium/ui/base/win/foreground_helper.cc b/chromium/ui/base/win/foreground_helper.cc index 219b26fc1fa..72830122ac0 100644 --- a/chromium/ui/base/win/foreground_helper.cc +++ b/chromium/ui/base/win/foreground_helper.cc @@ -43,7 +43,7 @@ HRESULT ForegroundHelper::ForegroundHotKey(HWND window) { hotkey.type = INPUT_KEYBOARD; hotkey.ki.wVk = VK_F22; if (1 != SendInput(1, &hotkey, sizeof(hotkey))) { - LOG(WARNING) << "Failed to send input"; + LOG(WARNING) << "Failed to send input; GetLastError(): " << GetLastError(); return E_FAIL; } @@ -72,13 +72,9 @@ HRESULT ForegroundHelper::ForegroundHotKey(HWND window) { return S_OK; } - // Handle the registered Hotkey being pressed. -LRESULT ForegroundHelper::OnHotKey(UINT message, - WPARAM wparam, - LPARAM lparam, - BOOL& handled) { +// Handle the registered Hotkey being pressed. +void ForegroundHelper::OnHotKey(int id, UINT vcode, UINT modifiers) { SetForegroundWindow(window_); - return 1; } } // namespace ui diff --git a/chromium/ui/base/win/foreground_helper.h b/chromium/ui/base/win/foreground_helper.h index a2d9ea2a541..8387c13b7ee 100644 --- a/chromium/ui/base/win/foreground_helper.h +++ b/chromium/ui/base/win/foreground_helper.h @@ -6,7 +6,7 @@ #define UI_BASE_WIN_FOREGROUND_HELPER_H_ #include "base/logging.h" -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" #include "ui/gfx/win/window_impl.h" namespace ui { @@ -18,13 +18,13 @@ namespace ui { // to be capable of moving to the foreground. // // This is probably leveraging a windows bug. -class UI_EXPORT ForegroundHelper : public gfx::WindowImpl { +class UI_BASE_EXPORT ForegroundHelper : public gfx::WindowImpl { public: ForegroundHelper() : window_(NULL) { } - BEGIN_MSG_MAP_EX(ForegroundHelper) - MESSAGE_HANDLER(WM_HOTKEY, OnHotKey) - END_MSG_MAP() + CR_BEGIN_MSG_MAP_EX(ForegroundHelper) + CR_MSG_WM_HOTKEY(OnHotKey) + CR_END_MSG_MAP() // Brings a window into the foreground. // Can be called from any window, even if the caller is not the @@ -35,7 +35,7 @@ class UI_EXPORT ForegroundHelper : public gfx::WindowImpl { HRESULT ForegroundHotKey(HWND window); // Handle the registered Hotkey being pressed. - LRESULT OnHotKey(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled); + void OnHotKey(int id, UINT vcode, UINT modifiers); HWND window_; diff --git a/chromium/ui/base/win/hidden_window.cc b/chromium/ui/base/win/hidden_window.cc index 3b21519597c..d04f2a3f7fa 100644 --- a/chromium/ui/base/win/hidden_window.cc +++ b/chromium/ui/base/win/hidden_window.cc @@ -42,9 +42,9 @@ class TempParent : public gfx::WindowImpl { void OnClose() { } - BEGIN_MSG_MAP_EX(WebContentsViewWin) - MSG_WM_CLOSE(OnClose) - END_MSG_MAP() + CR_BEGIN_MSG_MAP_EX(WebContentsViewWin) + CR_MSG_WM_CLOSE(OnClose) + CR_END_MSG_MAP() }; } // namespace diff --git a/chromium/ui/base/win/hidden_window.h b/chromium/ui/base/win/hidden_window.h index e3189a6a688..6cc2fd0dd6d 100644 --- a/chromium/ui/base/win/hidden_window.h +++ b/chromium/ui/base/win/hidden_window.h @@ -7,13 +7,13 @@ #include <windows.h> -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" namespace ui { // Returns an HWND that can be used as a temporary parent. The returned HWND is // never destroyed. -UI_EXPORT HWND GetHiddenWindow(); +UI_BASE_EXPORT HWND GetHiddenWindow(); } // namespace ui diff --git a/chromium/ui/base/win/hwnd_subclass.cc b/chromium/ui/base/win/hwnd_subclass.cc index 34e2bf4fad6..8628a7c2e8b 100644 --- a/chromium/ui/base/win/hwnd_subclass.cc +++ b/chromium/ui/base/win/hwnd_subclass.cc @@ -142,11 +142,8 @@ LRESULT HWNDSubclass::OnWndProc(HWND hwnd, if (GetTouchInputInfoWrapper(reinterpret_cast<HTOUCHINPUT>(l_param), 1, &point, sizeof(TOUCHINPUT))) { - POINT touch_location = { - TOUCH_COORD_TO_PIXEL(point.x) / - gfx::win::GetUndocumentedDPITouchScale(), - TOUCH_COORD_TO_PIXEL(point.y) / - gfx::win::GetUndocumentedDPITouchScale()}; + POINT touch_location = {TOUCH_COORD_TO_PIXEL(point.x), + TOUCH_COORD_TO_PIXEL(point.y)}; HWND actual_target = WindowFromPoint(touch_location); if (actual_target != hwnd) { return SendMessage(actual_target, message, w_param, l_param); diff --git a/chromium/ui/base/win/hwnd_subclass.h b/chromium/ui/base/win/hwnd_subclass.h index 834a45a376a..0a371cb2c8b 100644 --- a/chromium/ui/base/win/hwnd_subclass.h +++ b/chromium/ui/base/win/hwnd_subclass.h @@ -5,19 +5,19 @@ #ifndef UI_BASE_WIN_HWND_SUBCLASS_H_ #define UI_BASE_WIN_HWND_SUBCLASS_H_ -#include <vector> #include <windows.h> +#include <vector> #include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" #include "ui/base/view_prop.h" namespace ui { // Classes implementing this interface get the opportunity to handle and consume // messages before they are sent to their target HWND. -class UI_EXPORT HWNDMessageFilter { +class UI_BASE_EXPORT HWNDMessageFilter { public: virtual ~HWNDMessageFilter(); @@ -38,7 +38,7 @@ class UI_EXPORT HWNDMessageFilter { // An object that instance-subclasses a window. If the window has already been // instance-subclassed, that subclassing is lost. -class UI_EXPORT HWNDSubclass { +class UI_BASE_EXPORT HWNDSubclass { public: ~HWNDSubclass(); diff --git a/chromium/ui/base/win/internal_constants.cc b/chromium/ui/base/win/internal_constants.cc new file mode 100644 index 00000000000..325ab90468b --- /dev/null +++ b/chromium/ui/base/win/internal_constants.cc @@ -0,0 +1,13 @@ +// Copyright (c) 2014 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 "ui/base/win/internal_constants.h" + +namespace ui { + +const wchar_t kIgnoreTouchMouseActivateForWindow[] = + L"Chrome.IgnoreMouseActivate"; + +} // namespace ui + diff --git a/chromium/ui/base/win/internal_constants.h b/chromium/ui/base/win/internal_constants.h new file mode 100644 index 00000000000..d81c34de4f1 --- /dev/null +++ b/chromium/ui/base/win/internal_constants.h @@ -0,0 +1,20 @@ +// Copyright (c) 2014 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 UI_BASE_WIN_INTERNAL_CONSTANTS_H_ +#define UI_BASE_WIN_INTERNAL_CONSTANTS_H_ + +#include "ui/base/ui_base_export.h" + +namespace ui { + +// This window property if set on the window does not activate the window for a +// touch based WM_MOUSEACTIVATE message. +UI_BASE_EXPORT extern const wchar_t kIgnoreTouchMouseActivateForWindow[]; + +} // namespace ui + +#endif // UI_BASE_WIN_INTERNAL_CONSTANTS_H_ + + diff --git a/chromium/ui/base/win/lock_state.h b/chromium/ui/base/win/lock_state.h index 637be034a50..be9c912678a 100644 --- a/chromium/ui/base/win/lock_state.h +++ b/chromium/ui/base/win/lock_state.h @@ -6,12 +6,12 @@ #define UI_BASE_WIN_LOCK_STATE_H_ #include "base/basictypes.h" -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" namespace ui { // Returns true if the screen is currently locked. -UI_EXPORT bool IsWorkstationLocked(); +UI_BASE_EXPORT bool IsWorkstationLocked(); } // namespace ui diff --git a/chromium/ui/base/win/message_box_win.cc b/chromium/ui/base/win/message_box_win.cc index c78e98baf66..6500f986163 100644 --- a/chromium/ui/base/win/message_box_win.cc +++ b/chromium/ui/base/win/message_box_win.cc @@ -14,8 +14,8 @@ namespace ui { // RTL locale, we need to make sure that LTR strings are rendered correctly by // adding the appropriate Unicode directionality marks. int MessageBox(HWND hwnd, - const string16& text, - const string16& caption, + const base::string16& text, + const base::string16& caption, UINT flags) { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoMessageBox)) return IDOK; @@ -24,11 +24,11 @@ int MessageBox(HWND hwnd, if (base::i18n::IsRTL()) actual_flags |= MB_RIGHT | MB_RTLREADING; - string16 localized_text = text; + base::string16 localized_text = text; base::i18n::AdjustStringForLocaleDirection(&localized_text); const wchar_t* text_ptr = localized_text.c_str(); - string16 localized_caption = caption; + base::string16 localized_caption = caption; base::i18n::AdjustStringForLocaleDirection(&localized_caption); const wchar_t* caption_ptr = localized_caption.c_str(); diff --git a/chromium/ui/base/win/message_box_win.h b/chromium/ui/base/win/message_box_win.h index a91c00f7a37..f48bec3e4fa 100644 --- a/chromium/ui/base/win/message_box_win.h +++ b/chromium/ui/base/win/message_box_win.h @@ -8,7 +8,7 @@ #include <windows.h> #include "base/strings/string16.h" -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" namespace ui { @@ -16,10 +16,10 @@ namespace ui { // MessageBox function allows us to control certain RTL locale flags so that // callers don't have to worry about adding these flags when running in a // right-to-left locale. -UI_EXPORT int MessageBox(HWND hwnd, - const string16& text, - const string16& caption, - UINT flags); +UI_BASE_EXPORT int MessageBox(HWND hwnd, + const base::string16& text, + const base::string16& caption, + UINT flags); } // namespace ui diff --git a/chromium/ui/base/win/mouse_wheel_util.h b/chromium/ui/base/win/mouse_wheel_util.h index d6266d7b3e6..b9f5872b0c4 100644 --- a/chromium/ui/base/win/mouse_wheel_util.h +++ b/chromium/ui/base/win/mouse_wheel_util.h @@ -7,7 +7,7 @@ #include <windows.h> -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" namespace ui { @@ -17,7 +17,7 @@ class ViewProp; // We reroute the mouse wheel messages to such HWND when they are under the // mouse pointer (but are not the active window). Callers own the returned // object. -UI_EXPORT ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); +UI_BASE_EXPORT ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); // Forwards mouse wheel messages to the window under it. // Windows sends mouse wheel messages to the currently active window. @@ -26,8 +26,9 @@ UI_EXPORT ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); // mouse wheel in order to scroll that window. This is arguably a better user // experience. The returns value says whether the mouse wheel message was // successfully redirected. -UI_EXPORT bool RerouteMouseWheel(HWND window, WPARAM w_param, - LPARAM l_param); +UI_BASE_EXPORT bool RerouteMouseWheel(HWND window, + WPARAM w_param, + LPARAM l_param); } // namespace ui diff --git a/chromium/ui/base/win/scoped_ole_initializer.h b/chromium/ui/base/win/scoped_ole_initializer.h index 6b115f9a3ab..b2e81d22c41 100644 --- a/chromium/ui/base/win/scoped_ole_initializer.h +++ b/chromium/ui/base/win/scoped_ole_initializer.h @@ -8,11 +8,11 @@ #include <ole2.h> #include "base/basictypes.h" -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" namespace ui { -class UI_EXPORT ScopedOleInitializer { +class UI_BASE_EXPORT ScopedOleInitializer { public: ScopedOleInitializer(); ~ScopedOleInitializer(); diff --git a/chromium/ui/base/win/shell.cc b/chromium/ui/base/win/shell.cc index ff1a4ffec41..7866e713a88 100644 --- a/chromium/ui/base/win/shell.cc +++ b/chromium/ui/base/win/shell.cc @@ -24,7 +24,7 @@ namespace win { // Show the Windows "Open With" dialog box to ask the user to pick an app to // open the file with. -bool OpenItemWithExternalApp(const string16& full_path) { +bool OpenItemWithExternalApp(const base::string16& full_path) { SHELLEXECUTEINFO sei = { sizeof(sei) }; sei.fMask = SEE_MASK_FLAG_DDEWAIT; sei.nShow = SW_SHOWNORMAL; @@ -33,9 +33,9 @@ bool OpenItemWithExternalApp(const string16& full_path) { return (TRUE == ::ShellExecuteExW(&sei)); } -bool OpenAnyViaShell(const string16& full_path, - const string16& directory, - const string16& args, +bool OpenAnyViaShell(const base::string16& full_path, + const base::string16& directory, + const base::string16& args, DWORD mask) { SHELLEXECUTEINFO sei = { sizeof(sei) }; sei.fMask = mask; @@ -54,11 +54,11 @@ bool OpenAnyViaShell(const string16& full_path, bool OpenItemViaShell(const base::FilePath& full_path) { return OpenAnyViaShell(full_path.value(), full_path.DirName().value(), - string16(), 0); + base::string16(), 0); } bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path) { - return OpenAnyViaShell(full_path.value(), string16(), string16(), + return OpenAnyViaShell(full_path.value(), base::string16(), base::string16(), SEE_MASK_NOZONECHECKS | SEE_MASK_FLAG_DDEWAIT); } @@ -80,10 +80,10 @@ bool PreventWindowFromPinning(HWND hwnd) { // TODO(calamity): investigate moving this out of the UI thread as COM // operations may spawn nested message loops which can cause issues. -void SetAppDetailsForWindow(const string16& app_id, - const string16& app_icon, - const string16& relaunch_command, - const string16& relaunch_display_name, +void SetAppDetailsForWindow(const base::string16& app_id, + const base::string16& app_icon, + const base::string16& relaunch_command, + const base::string16& relaunch_display_name, HWND hwnd) { // This functionality is only available on Win7+. It also doesn't make sense // to do this for Chrome Metro. @@ -112,19 +112,27 @@ void SetAppDetailsForWindow(const string16& app_id, } } -void SetAppIdForWindow(const string16& app_id, HWND hwnd) { - SetAppDetailsForWindow(app_id, string16(), string16(), string16(), hwnd); +void SetAppIdForWindow(const base::string16& app_id, HWND hwnd) { + SetAppDetailsForWindow(app_id, + base::string16(), + base::string16(), + base::string16(), + hwnd); } -void SetAppIconForWindow(const string16& app_icon, HWND hwnd) { - SetAppDetailsForWindow(string16(), app_icon, string16(), string16(), hwnd); +void SetAppIconForWindow(const base::string16& app_icon, HWND hwnd) { + SetAppDetailsForWindow(base::string16(), + app_icon, + base::string16(), + base::string16(), + hwnd); } -void SetRelaunchDetailsForWindow(const string16& relaunch_command, - const string16& display_name, +void SetRelaunchDetailsForWindow(const base::string16& relaunch_command, + const base::string16& display_name, HWND hwnd) { - SetAppDetailsForWindow(string16(), - string16(), + SetAppDetailsForWindow(base::string16(), + base::string16(), relaunch_command, display_name, hwnd); diff --git a/chromium/ui/base/win/shell.h b/chromium/ui/base/win/shell.h index e85d2b43fdc..e732abf8c54 100644 --- a/chromium/ui/base/win/shell.h +++ b/chromium/ui/base/win/shell.h @@ -8,7 +8,7 @@ #include <windows.h> #include "base/strings/string16.h" -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" namespace base { class FilePath; @@ -21,58 +21,62 @@ namespace win { // default application registered for the file specified by 'full_path', // ask the user, via the Windows "Open With" dialog. // Returns 'true' on successful open, 'false' otherwise. -UI_EXPORT bool OpenItemViaShell(const base::FilePath& full_path); +UI_BASE_EXPORT bool OpenItemViaShell(const base::FilePath& full_path); // The download manager now writes the alternate data stream with the // zone on all downloads. This function is equivalent to OpenItemViaShell // without showing the zone warning dialog. -UI_EXPORT bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path); +UI_BASE_EXPORT bool OpenItemViaShellNoZoneCheck( + const base::FilePath& full_path); // Lower level function that allows opening of non-files like urls or GUIDs // don't use it if one of the above will do. |mask| is a valid combination // of SEE_MASK_FLAG_XXX as stated in msdn. If there is no default application // registered for the item, it behaves the same as OpenItemViaShell. -UI_EXPORT bool OpenAnyViaShell(const string16& full_path, - const string16& directory, - const string16& args, - DWORD mask); +UI_BASE_EXPORT bool OpenAnyViaShell(const base::string16& full_path, + const base::string16& directory, + const base::string16& args, + DWORD mask); // Ask the user, via the Windows "Open With" dialog, for an application to use // to open the file specified by 'full_path'. // Returns 'true' on successful open, 'false' otherwise. -bool OpenItemWithExternalApp(const string16& full_path); +bool OpenItemWithExternalApp(const base::string16& full_path); // Disables the ability of the specified window to be pinned to the taskbar or // the Start menu. This will remove "Pin this program to taskbar" from the // taskbar menu of the specified window. -UI_EXPORT bool PreventWindowFromPinning(HWND hwnd); +UI_BASE_EXPORT bool PreventWindowFromPinning(HWND hwnd); // Sets the application id, app icon, relaunch command and relaunch display name // for the given window. -UI_EXPORT void SetAppDetailsForWindow(const string16& app_id, - const string16& app_icon, - const string16& relaunch_command, - const string16& relaunch_display_name, - HWND hwnd); +UI_BASE_EXPORT void SetAppDetailsForWindow( + const base::string16& app_id, + const base::string16& app_icon, + const base::string16& relaunch_command, + const base::string16& relaunch_display_name, + HWND hwnd); // Sets the application id given as the Application Model ID for the window // specified. This method is used to insure that different web applications // do not group together on the Win7 task bar. -UI_EXPORT void SetAppIdForWindow(const string16& app_id, HWND hwnd); +UI_BASE_EXPORT void SetAppIdForWindow(const base::string16& app_id, HWND hwnd); // Sets the application icon for the window specified. -UI_EXPORT void SetAppIconForWindow(const string16& app_icon, HWND hwnd); +UI_BASE_EXPORT void SetAppIconForWindow(const base::string16& app_icon, + HWND hwnd); // Sets the relaunch command and relaunch display name for the window specified. // Windows will use this information for grouping on the taskbar, and to create // a shortcut if the window is pinned to the taskbar. -UI_EXPORT void SetRelaunchDetailsForWindow(const string16& relaunch_command, - const string16& display_name, - HWND hwnd); +UI_BASE_EXPORT void SetRelaunchDetailsForWindow( + const base::string16& relaunch_command, + const base::string16& display_name, + HWND hwnd); // Returns true if composition is available and turned on on the current // platform. -UI_EXPORT bool IsAeroGlassEnabled(); +UI_BASE_EXPORT bool IsAeroGlassEnabled(); } // namespace win } // namespace ui diff --git a/chromium/ui/base/win/touch_input.cc b/chromium/ui/base/win/touch_input.cc index a369ab1f670..0114bdd3a7f 100644 --- a/chromium/ui/base/win/touch_input.cc +++ b/chromium/ui/base/win/touch_input.cc @@ -6,10 +6,10 @@ namespace ui { -UI_EXPORT BOOL GetTouchInputInfoWrapper(HTOUCHINPUT handle, - UINT count, - PTOUCHINPUT pointer, - int size) { +BOOL GetTouchInputInfoWrapper(HTOUCHINPUT handle, + UINT count, + PTOUCHINPUT pointer, + int size) { typedef BOOL(WINAPI *GetTouchInputInfoPtr)(HTOUCHINPUT, UINT, PTOUCHINPUT, int); static GetTouchInputInfoPtr get_touch_input_info_func = diff --git a/chromium/ui/base/win/touch_input.h b/chromium/ui/base/win/touch_input.h index dd0d82916b5..f113ec5b463 100644 --- a/chromium/ui/base/win/touch_input.h +++ b/chromium/ui/base/win/touch_input.h @@ -7,16 +7,16 @@ #include <windows.h> -#include "ui/base/ui_export.h" +#include "ui/base/ui_base_export.h" namespace ui { // Wrapper for GetTouchInputInfo, which is not defined before Win7. For // earlier OS's, this function returns FALSE. -UI_EXPORT BOOL GetTouchInputInfoWrapper(HTOUCHINPUT handle, - UINT count, - PTOUCHINPUT pointer, - int size); +UI_BASE_EXPORT BOOL GetTouchInputInfoWrapper(HTOUCHINPUT handle, + UINT count, + PTOUCHINPUT pointer, + int size); } // namespace ui diff --git a/chromium/ui/base/win/window_event_target.cc b/chromium/ui/base/win/window_event_target.cc new file mode 100644 index 00000000000..555cd5af333 --- /dev/null +++ b/chromium/ui/base/win/window_event_target.cc @@ -0,0 +1,16 @@ +// Copyright (c) 2014 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 "ui/base/win/window_event_target.h" + +namespace ui { + +const char WindowEventTarget::kWin32InputEventTarget[] + = "Win32_InputEventTarget"; + +WindowEventTarget::WindowEventTarget() {} + +WindowEventTarget::~WindowEventTarget() {} + +} // namespace ui diff --git a/chromium/ui/base/win/window_event_target.h b/chromium/ui/base/win/window_event_target.h new file mode 100644 index 00000000000..c7bb6700d8c --- /dev/null +++ b/chromium/ui/base/win/window_event_target.h @@ -0,0 +1,71 @@ +// Copyright (c) 2014 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 UI_BASE_WIN_WINDOW_EVENT_TARGET_H_ +#define UI_BASE_WIN_WINDOW_EVENT_TARGET_H_ + +#include <windows.h> + +#include "base/basictypes.h" +#include "ui/base/ui_base_export.h" + +namespace ui { + +// This interface is implemented by classes who get input events forwarded to +// them from others. E.g. would be a win32 parent child relationship where the +// child forwards input events to the parent after doing minimal processing. +class UI_BASE_EXPORT WindowEventTarget { + public: + static const char kWin32InputEventTarget[]; + + // Handles mouse events like WM_MOUSEMOVE, WM_LBUTTONDOWN, etc. + // The |message| parameter identifies the message. + // The |w_param| and |l_param| values are dependent on the type of the + // message. + // Returns the result of processing the message. + virtual LRESULT HandleMouseMessage(unsigned int message, + WPARAM w_param, + LPARAM l_param) = 0; + + // Handles keyboard events like WM_KEYDOWN/WM_KEYUP, etc. + // The |message| parameter identifies the message. + // The |w_param| and |l_param| values are dependent on the type of the + // message. + // Returns the result of processing the message. + virtual LRESULT HandleKeyboardMessage(unsigned int message, + WPARAM w_param, + LPARAM l_param) = 0; + + // Handles WM_TOUCH events. + // The |message| parameter identifies the message. + // The |w_param| and |l_param| values are as per MSDN docs. + // Returns the result of processing the message. + virtual LRESULT HandleTouchMessage(unsigned int message, + WPARAM w_param, + LPARAM l_param) = 0; + + // Handles scroll messages like WM_VSCROLL and WM_HSCROLL. + // The |message| parameter identifies the scroll message. + // The |w_param| and |l_param| values are dependent on the type of scroll. + virtual LRESULT HandleScrollMessage(unsigned int message, + WPARAM w_param, + LPARAM l_param) = 0; + + // Handles the WM_NCHITTEST message + // The |message| parameter identifies the message. + // The |w_param| and |l_param| values are as per MSDN docs. + // Returns the result of processing the message. + virtual LRESULT HandleNcHitTestMessage(unsigned int message, + WPARAM w_param, + LPARAM l_param) = 0; + protected: + WindowEventTarget(); + virtual ~WindowEventTarget(); +}; + +} // namespace ui + +#endif // UI_BASE_WIN_WINDOW_EVENT_TARGET_H_ + + |