Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1242)

Unified Diff: webkit/glue/chromium_bridge_impl.cc

Issue 58008: Replace webkit/glue/screen_info.h with WebKit/chromium/public/WebScreenInfo.h... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/glue/chromium_bridge_impl.cc
===================================================================
--- webkit/glue/chromium_bridge_impl.cc (revision 12916)
+++ webkit/glue/chromium_bridge_impl.cc (working copy)
@@ -31,6 +31,7 @@
#include "build/build_config.h"
#include "googleurl/src/url_util.h"
#include "skia/ext/skia_utils_win.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
#include "webkit/glue/chrome_client_impl.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/plugins/plugin_instance.h"
@@ -38,7 +39,7 @@
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webplugin_impl.h"
-#include "webkit/glue/webview.h"
+#include "webkit/glue/webview_impl.h"
#if defined(OS_WIN)
#include <windows.h>
@@ -72,6 +73,17 @@
return static_cast<ChromeClientImpl*>(page->chrome()->client());
}
+WebViewImpl* ToWebView(WebCore::Widget* widget) {
+ ChromeClientImpl* chrome_client = ToChromeClient(widget);
+ if (!chrome_client)
+ return NULL;
+ return chrome_client->webview();
+}
+
+WebCore::IntRect ToIntRect(const WebKit::WebRect& input) {
+ return WebCore::IntRect(input.x, input.y, input.width, input.height);
+}
+
} // namespace
namespace WebCore {
@@ -163,25 +175,38 @@
// Screen ---------------------------------------------------------------------
int ChromiumBridge::screenDepth(Widget* widget) {
- return webkit_glue::GetScreenInfo(ToNativeId(widget)).depth;
+ WebViewImpl* view = ToWebView(widget);
+ if (!view || !view->delegate())
+ return NULL;
+ return view->delegate()->GetScreenInfo(view).depth;
}
int ChromiumBridge::screenDepthPerComponent(Widget* widget) {
- return webkit_glue::GetScreenInfo(ToNativeId(widget)).depth_per_component;
+ WebViewImpl* view = ToWebView(widget);
+ if (!view || !view->delegate())
+ return NULL;
+ return view->delegate()->GetScreenInfo(view).depthPerComponent;
}
bool ChromiumBridge::screenIsMonochrome(Widget* widget) {
- return webkit_glue::GetScreenInfo(ToNativeId(widget)).is_monochrome;
+ WebViewImpl* view = ToWebView(widget);
+ if (!view || !view->delegate())
+ return NULL;
+ return view->delegate()->GetScreenInfo(view).isMonochrome;
}
IntRect ChromiumBridge::screenRect(Widget* widget) {
- return webkit_glue::ToIntRect(
- webkit_glue::GetScreenInfo(ToNativeId(widget)).rect);
+ WebViewImpl* view = ToWebView(widget);
+ if (!view || !view->delegate())
+ return IntRect();
+ return ToIntRect(view->delegate()->GetScreenInfo(view).rect);
}
IntRect ChromiumBridge::screenAvailableRect(Widget* widget) {
- return webkit_glue::ToIntRect(
- webkit_glue::GetScreenInfo(ToNativeId(widget)).available_rect);
+ WebViewImpl* view = ToWebView(widget);
+ if (!view || !view->delegate())
+ return IntRect();
+ return ToIntRect(view->delegate()->GetScreenInfo(view).availableRect);
}
// Widget ---------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698