diff options
author | Steve Block <steveblock@google.com> | 2011-06-08 08:26:01 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-08 08:26:01 -0700 |
commit | 3742ac093d35d923c81693096ab6671e9b147700 (patch) | |
tree | c2add9100f789dad45ef1ec5328bddde02c47a4c /Source/WebKit/win/WebView.cpp | |
parent | 901401d90459bc22580842455d4588b9a697514d (diff) | |
parent | e5926f4a0d6adc9ad4a75824129f117181953560 (diff) | |
download | external_webkit-3742ac093d35d923c81693096ab6671e9b147700.zip external_webkit-3742ac093d35d923c81693096ab6671e9b147700.tar.gz external_webkit-3742ac093d35d923c81693096ab6671e9b147700.tar.bz2 |
Merge changes I55c6d71a,Ifb3277d4,Ia1b847a2,I7ba9cf3f,Ida2b2a8a,I1280ec90,I72f818d5,I2e3b588b,I9a4e6289,Ia724c78b,Icd8612c8,Ie31b15d7,Ie125edae,I77941a88,I89dae78b,I3516e5ca,I1a4c17b5,I2c4ecc1a,I9c8e6537,Ifac13115,Ie1f80e09,Ia541ed77,I60ce9d78
* changes:
Merge WebKit at r82507: Update ThirdPartyProject.prop
Merge WebKit at r82507: Cherry-pick change r88166 to add INSPECTOR guards to ScriptProfiler
Merge WebKit at r82507: Work around a V8 bug
Merge WebKit at r82507: JNIType renamed to JavaType
Merge WebKit at r82507: IconDatabaseClient interface expanded
Merge WebKit at r82507: Don't use new loss-free code path in HTMLCanvasElement::toDataURL()
Merge WebKit at r82507: IcondDatabaseBase::iconForPageURL() renamed
Merge WebKit at r82507: IconDatabaseBase::Open() signature changed
Merge WebKit at r82507: Node::isContentEditable() renamed
Merge WebKit at r82507: Use icon database through IconDatabaseBase
Merge WebKit at r82507: toInputElement() is now a member of Node
Merge WebKit at r82507: FrameLoaderClient::objectContentType() signature changed
Merge WebKit at r82507: StringImpl::computeHash() removed
Merge WebKit at r82507: Stub out FontPlatformData::setOrientation()
Merge WebKit at r82507: Path::strokeBoundingRect() is now const
Merge WebKit at r82507: Add missing UnusedParam.h include in ApplicationCacheGroup.cpp
Merge WebKit at r82507: Continue to use Android's version of FontPlatformData.h
Merge WebKit at r82507: Update signature of FontCustomPlatformData::fontPlatformData()
Merge WebKit at r82507: Fix conflicts due to JNI refactoring
Merge WebKit at r82507: Fix conflicts due to new StorageTracker
Merge WebKit at r82507: Fix conflicts
Merge WebKit at r82507: Fix makefiles
Merge WebKit at r82507: Initial merge by git
Diffstat (limited to 'Source/WebKit/win/WebView.cpp')
-rw-r--r-- | Source/WebKit/win/WebView.cpp | 67 |
1 files changed, 22 insertions, 45 deletions
diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp index 0fb8047..69f83de 100644 --- a/Source/WebKit/win/WebView.cpp +++ b/Source/WebKit/win/WebView.cpp @@ -128,6 +128,7 @@ #include <WebCore/SelectionController.h> #include <WebCore/Settings.h> #include <WebCore/SimpleFontData.h> +#include <WebCore/SystemInfo.h> #include <WebCore/TypingCommand.h> #include <WebCore/WindowMessageBroadcaster.h> #include <wtf/Threading.h> @@ -161,7 +162,7 @@ #include <comutil.h> #include <dimm.h> #include <oleacc.h> -#include <tchar.h> +#include <wchar.h> #include <windowsx.h> #include <wtf/HashSet.h> #include <wtf/text/CString.h> @@ -184,8 +185,7 @@ using JSC::JSLock; static HMODULE accessibilityLib; static HashSet<WebView*> pendingDeleteBackingStoreSet; -static String osVersion(); -static String webKitVersion(); +static String webKitVersionString(); WebView* kit(Page* page) { @@ -1244,9 +1244,10 @@ bool WebView::canHandleRequest(const WebCore::ResourceRequest& request) String WebView::standardUserAgentWithApplicationName(const String& applicationName) { - if (applicationName.isEmpty()) - return makeString("Mozilla/5.0 (", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko)"); - return makeString("Mozilla/5.0 (", osVersion(), ") AppleWebKit/", webKitVersion(), " (KHTML, like Gecko) ", applicationName); + DEFINE_STATIC_LOCAL(String, osVersion, (windowsVersionForUAString())); + DEFINE_STATIC_LOCAL(String, webKitVersion, (webKitVersionString())); + + return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)", applicationName.isEmpty() ? "" : " ", applicationName); } Page* WebView::page() @@ -1675,12 +1676,12 @@ bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isMouseHWheel) HWND focusedWindow = GetFocus(); if (focusedWindow && focusedWindow != m_viewWindow) { // Our focus is on a different hwnd, see if it's a PopupMenu and if so, set the focus back on us (which will hide the popup). - TCHAR className[256]; + WCHAR className[256]; // Make sure truncation won't affect the comparison. - ASSERT(WTF_ARRAY_LENGTH(className) > _tcslen(PopupMenuWin::popupClassName())); + ASSERT(WTF_ARRAY_LENGTH(className) > wcslen(PopupMenuWin::popupClassName())); - if (GetClassName(focusedWindow, className, WTF_ARRAY_LENGTH(className)) && !_tcscmp(className, PopupMenuWin::popupClassName())) { + if (GetClassNameW(focusedWindow, className, WTF_ARRAY_LENGTH(className)) && !wcscmp(className, PopupMenuWin::popupClassName())) { // We don't let the WebView scroll here for two reasons - 1) To match Firefox behavior, 2) If we do scroll, we lose the // focus ring around the select menu. SetFocus(m_viewWindow); @@ -2336,31 +2337,7 @@ bool WebView::developerExtrasEnabled() const #endif } -static String osVersion() -{ - String osVersion; - OSVERSIONINFO versionInfo = {0}; - versionInfo.dwOSVersionInfoSize = sizeof(versionInfo); - GetVersionEx(&versionInfo); - - if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - if (versionInfo.dwMajorVersion == 4) { - if (versionInfo.dwMinorVersion == 0) - osVersion = "Windows 95"; - else if (versionInfo.dwMinorVersion == 10) - osVersion = "Windows 98"; - else if (versionInfo.dwMinorVersion == 90) - osVersion = "Windows 98; Win 9x 4.90"; - } - } else if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) - osVersion = makeString("Windows NT ", String::number(versionInfo.dwMajorVersion), '.', String::number(versionInfo.dwMinorVersion)); - - if (!osVersion.length()) - osVersion = makeString("Windows ", String::number(versionInfo.dwMajorVersion), '.', String::number(versionInfo.dwMinorVersion)); - return osVersion; -} - -static String webKitVersion() +static String webKitVersionString() { LPWSTR buildNumberStringPtr; if (!::LoadStringW(gInstance, BUILD_NUMBER, reinterpret_cast<LPWSTR>(&buildNumberStringPtr), 0) || !buildNumberStringPtr) @@ -2523,15 +2500,15 @@ bool WebView::shouldInitializeTrackPointHack() return shouldCreateScrollbars; hasRunTrackPointCheck = true; - const TCHAR trackPointKeys[][50] = { TEXT("Software\\Lenovo\\TrackPoint"), - TEXT("Software\\Lenovo\\UltraNav"), - TEXT("Software\\Alps\\Apoint\\TrackPoint"), - TEXT("Software\\Synaptics\\SynTPEnh\\UltraNavUSB"), - TEXT("Software\\Synaptics\\SynTPEnh\\UltraNavPS2") }; + const WCHAR trackPointKeys[][50] = { L"Software\\Lenovo\\TrackPoint", + L"Software\\Lenovo\\UltraNav", + L"Software\\Alps\\Apoint\\TrackPoint", + L"Software\\Synaptics\\SynTPEnh\\UltraNavUSB", + L"Software\\Synaptics\\SynTPEnh\\UltraNavPS2" }; for (int i = 0; i < 5; ++i) { HKEY trackPointKey; - int readKeyResult = ::RegOpenKeyEx(HKEY_CURRENT_USER, trackPointKeys[i], 0, KEY_READ, &trackPointKey); + int readKeyResult = ::RegOpenKeyExW(HKEY_CURRENT_USER, trackPointKeys[i], 0, KEY_READ, &trackPointKey); ::RegCloseKey(trackPointKey); if (readKeyResult == ERROR_SUCCESS) { shouldCreateScrollbars = true; @@ -2562,8 +2539,8 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame( // If we detected a registry key belonging to a TrackPoint driver, then create fake trackpoint // scrollbars, so the WebView will receive WM_VSCROLL and WM_HSCROLL messages. We create one // vertical scrollbar and one horizontal to allow for receiving both types of messages. - ::CreateWindow(TEXT("SCROLLBAR"), TEXT("FAKETRACKPOINTHSCROLLBAR"), WS_CHILD | WS_VISIBLE | SBS_HORZ, 0, 0, 0, 0, m_viewWindow, 0, gInstance, 0); - ::CreateWindow(TEXT("SCROLLBAR"), TEXT("FAKETRACKPOINTVSCROLLBAR"), WS_CHILD | WS_VISIBLE | SBS_VERT, 0, 0, 0, 0, m_viewWindow, 0, gInstance, 0); + ::CreateWindowW(L"SCROLLBAR", L"FAKETRACKPOINTHSCROLLBAR", WS_CHILD | WS_VISIBLE | SBS_HORZ, 0, 0, 0, 0, m_viewWindow, 0, gInstance, 0); + ::CreateWindowW(L"SCROLLBAR", L"FAKETRACKPOINTVSCROLLBAR", WS_CHILD | WS_VISIBLE | SBS_VERT, 0, 0, 0, 0, m_viewWindow, 0, gInstance, 0); } hr = registerDragDrop(); @@ -3050,7 +3027,7 @@ HRESULT STDMETHODCALLTYPE WebView::setCustomTextEncodingName( if (FAILED(hr)) return hr; - if (oldEncoding != encodingName && (!oldEncoding || !encodingName || _tcscmp(oldEncoding, encodingName))) { + if (oldEncoding != encodingName && (!oldEncoding || !encodingName || wcscmp(oldEncoding, encodingName))) { if (Frame* coreFrame = core(m_mainFrame)) coreFrame->loader()->reloadWithOverrideEncoding(String(encodingName, SysStringLen(encodingName))); } @@ -5271,7 +5248,7 @@ const IMMDict& IMMDict::dict() IMMDict::IMMDict() { - m_instance = ::LoadLibrary(TEXT("IMM32.DLL")); + m_instance = ::LoadLibraryW(L"IMM32.DLL"); getContext = reinterpret_cast<getContextPtr>(::GetProcAddress(m_instance, "ImmGetContext")); ASSERT(getContext); releaseContext = reinterpret_cast<releaseContextPtr>(::GetProcAddress(m_instance, "ImmReleaseContext")); @@ -5928,7 +5905,7 @@ bool WebView::onGetObject(WPARAM wParam, LPARAM lParam, LRESULT& lResult) const return false; if (!accessibilityLib) { - if (!(accessibilityLib = ::LoadLibrary(TEXT("oleacc.dll")))) + if (!(accessibilityLib = ::LoadLibraryW(L"oleacc.dll"))) return false; } |