WebPageProxyWin.cpp [plain text]
#include "config.h"
#include "WebPageProxy.h"
#include "PageClient.h"
#include "WebPopupMenuProxyWin.h"
#include "resource.h"
#include <tchar.h>
#include <WebCore/SystemInfo.h>
#include <WebCore/WebCoreInstanceHandle.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/StringConcatenate.h>
using namespace WebCore;
namespace WebKit {
static String userVisibleWebKitVersionString()
{
LPWSTR buildNumberStringPtr;
if (!::LoadStringW(instanceHandle(), BUILD_NUMBER, reinterpret_cast<LPWSTR>(&buildNumberStringPtr), 0) || !buildNumberStringPtr)
return "534+";
return buildNumberStringPtr;
}
String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
{
DEFINE_STATIC_LOCAL(String, osVersion, (windowsVersionForUAString()));
DEFINE_STATIC_LOCAL(String, webKitVersion, (userVisibleWebKitVersionString()));
return makeString("Mozilla/5.0 (", osVersion, ") AppleWebKit/", webKitVersion, " (KHTML, like Gecko)", applicationNameForUserAgent.isEmpty() ? "" : " ", applicationNameForUserAgent);
}
void WebPageProxy::setPopupMenuSelectedIndex(int32_t selectedIndex)
{
if (!m_activePopupMenu)
return;
static_cast<WebPopupMenuProxyWin*>(m_activePopupMenu.get())->setFocusedIndex(selectedIndex);
}
HWND WebPageProxy::nativeWindow() const
{
return m_pageClient->nativeWindow();
}
void WebPageProxy::scheduleChildWindowGeometryUpdate(const WindowGeometry& geometry)
{
m_pageClient->scheduleChildWindowGeometryUpdate(geometry);
}
void WebPageProxy::didInstallOrUninstallPageOverlay(bool didInstall)
{
m_pageClient->didInstallOrUninstallPageOverlay(didInstall);
}
}