diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 22:28:40 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 22:28:40 +0000 |
commit | 5299356524f2e169ec97db351c44fe6da701984e (patch) | |
tree | 6aeb51a22c6d3c101fce0f17ea1e65a659232507 /chrome/common | |
parent | 9c8108d9356604eec57bf3c880f1580eb41fd1c3 (diff) | |
download | chromium_src-5299356524f2e169ec97db351c44fe6da701984e.zip chromium_src-5299356524f2e169ec97db351c44fe6da701984e.tar.gz chromium_src-5299356524f2e169ec97db351c44fe6da701984e.tar.bz2 |
Takes steps to make our PlatformScreen implementation more portable.
Introduces ChromiumBridge as a means for our WebCore port to depend on the embedder indirectly. This will be extended to support the rest of our port.
WebWidgetImpl and ChromeClientImpl both needed to have their platformWindow getter implemented. This fixes a regression related to the most recent merge.
Removes the orphaned Language.cpp (see the real one in the platform/chromium directory.
Changed webkit_glue::GetMonitorInfoForWindow to webkit_glue::GetScreenInfo. This resulted in a varied amount of plumbing changes. It also pushes the platform specific bits up into the browser where they belong.
ScreenInfo is a struct that is part of the webkit/glue API.
R=dglazkov,eseidel
Review URL: http://codereview.chromium.org/8761
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/ipc_message_utils.h | 24 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 25 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 9 |
3 files changed, 30 insertions, 28 deletions
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index 23a6f06..1a4c3b1 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -313,30 +313,6 @@ struct ParamTraits<SkBitmap> { }; template <> -struct ParamTraits<MONITORINFOEX> { - typedef MONITORINFOEX param_type; - static void Write(Message* m, const param_type& p) { - m->WriteData(reinterpret_cast<const char*>(&p), sizeof(MONITORINFOEX)); - } - static bool Read(const Message* m, void** iter, param_type* r) { - const char *data; - int data_size = 0; - bool result = m->ReadData(iter, &data, &data_size); - if (result && data_size == sizeof(MONITORINFOEX)) { - memcpy(r, data, sizeof(MONITORINFOEX)); - } else { - result = false; - NOTREACHED(); - } - - return result; - } - static void Log(const param_type& p, std::wstring* l) { - l->append(StringPrintf(L"<MONITORINFOEX>")); - } -}; - -template <> struct ParamTraits<std::string> { typedef std::string param_type; static void Write(Message* m, const param_type& p) { diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index edbfaf8..fbc1798 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -24,6 +24,7 @@ #include "webkit/glue/password_form.h" #include "webkit/glue/password_form_dom_manager.h" #include "webkit/glue/resource_loader_bridge.h" +#include "webkit/glue/screen_info.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webplugin.h" #include "webkit/glue/webpreferences.h" @@ -1649,6 +1650,30 @@ struct ParamTraits<WebDropData> { } }; +// Traits for ScreenInfo +template <> +struct ParamTraits<webkit_glue::ScreenInfo> { + typedef webkit_glue::ScreenInfo param_type; + static void Write(Message* m, const param_type& p) { + WriteParam(m, p.depth); + WriteParam(m, p.depth_per_component); + WriteParam(m, p.is_monochrome); + WriteParam(m, p.rect); + WriteParam(m, p.available_rect); + } + static bool Read(const Message* m, void** iter, param_type* p) { + return + ReadParam(m, iter, &p->depth) && + ReadParam(m, iter, &p->depth_per_component) && + ReadParam(m, iter, &p->is_monochrome) && + ReadParam(m, iter, &p->rect) && + ReadParam(m, iter, &p->available_rect); + } + static void Log(const param_type& p, std::wstring* l) { + l->append(L"<webkit_glue::ScreenInfo>"); + } +}; + } // namespace IPC #endif // CHROME_COMMON_RENDER_MESSAGES_H_ diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index b191d41..61da8e7 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -15,6 +15,7 @@ #include "webkit/glue/dom_operations.h" #include "webkit/glue/console_message_level.h" #include "webkit/glue/context_node_types.h" +#include "webkit/glue/screen_info.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webplugin.h" #include "webkit/glue/webinputevent.h" @@ -813,10 +814,10 @@ IPC_BEGIN_MESSAGES(ViewHost, 2) IPC_SYNC_MESSAGE_CONTROL1_0(ViewHostMsg_LoadFont, LOGFONT /* font data */) - // Returns the monitor information corresponding to the HWND. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetMonitorInfoForWindow, - HWND /* In: Window handle */, - MONITORINFOEX /* Out: Monitor information */) + // Returns ScreenInfo corresponding to the given window. + IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetScreenInfo, + gfx::ViewHandle /* window */, + webkit_glue::ScreenInfo /* results */) // Send the tooltip text for the current mouse position to the browser. IPC_MESSAGE_ROUTED1(ViewHostMsg_SetTooltipText, |