summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webframe_impl.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 21:58:04 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 21:58:04 +0000
commit02e80deede0729617aeb87128b1db3cd14b36d6b (patch)
treedfdec4f6e761c652ba8439dc36204cfa31246962 /webkit/glue/webframe_impl.cc
parent98aebc7fc44cc34ecfa5a33ade9a8aa511bb96a3 (diff)
downloadchromium_src-02e80deede0729617aeb87128b1db3cd14b36d6b.zip
chromium_src-02e80deede0729617aeb87128b1db3cd14b36d6b.tar.gz
chromium_src-02e80deede0729617aeb87128b1db3cd14b36d6b.tar.bz2
Switch to using WebPoint, WebRect, and WebSize in more of the glue
layer interface. This will help when we move those interfaces into the WebKit API. R=dglazkov Review URL: http://codereview.chromium.org/63126 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13381 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webframe_impl.cc')
-rw-r--r--webkit/glue/webframe_impl.cc43
1 files changed, 23 insertions, 20 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index ceca109..74e74dd 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -137,7 +137,9 @@ MSVC_POP_WARNING();
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
#include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
#include "webkit/glue/alt_error_page_resource_fetcher.h"
#include "webkit/glue/dom_operations.h"
#include "webkit/glue/dom_operations_private.h"
@@ -199,7 +201,9 @@ using WebCore::XPathResult;
using WebKit::WebConsoleMessage;
using WebKit::WebFindOptions;
+using WebKit::WebRect;
using WebKit::WebScriptSource;
+using WebKit::WebSize;
// Key for a StatsCounter tracking how many WebFrames are active.
static const char* const kWebFrameActiveCount = "WebFrameActiveCount";
@@ -935,7 +939,7 @@ void WebFrameImpl::IncreaseMatchCount(int count, int request_id) {
frames_scoping_count_ == 0);
}
-void WebFrameImpl::ReportFindInPageSelection(const gfx::Rect& selection_rect,
+void WebFrameImpl::ReportFindInPageSelection(const WebRect& selection_rect,
int active_match_ordinal,
int request_id) {
// Update the UI with the latest selection rect.
@@ -958,7 +962,7 @@ bool WebFrameImpl::Find(int request_id,
const string16& search_text,
const WebFindOptions& options,
bool wrap_within_frame,
- gfx::Rect* selection_rect) {
+ WebRect* selection_rect) {
WebCore::String webcore_string = webkit_glue::String16ToString(search_text);
WebFrameImpl* const main_frame_impl =
@@ -1026,10 +1030,10 @@ bool WebFrameImpl::Find(int request_id,
#if defined(OS_WIN)
// TODO(pinkerton): Fix Mac scrolling to be more like Win ScrollView
if (selection_rect) {
- gfx::Rect rect = webkit_glue::FromIntRect(
+ WebRect rect = webkit_glue::IntRectToWebRect(
frame()->view()->convertToContainingWindow(curr_selection_rect));
- rect.Offset(-frameview()->scrollOffset().width(),
- -frameview()->scrollOffset().height());
+ rect.x -= frameview()->scrollOffset().width();
+ rect.y -= frameview()->scrollOffset().height();
*selection_rect = rect;
ReportFindInPageSelection(rect,
@@ -1274,10 +1278,10 @@ void WebFrameImpl::ScopeStringMatches(int request_id,
result_bounds.move(-frameview()->scrollOffset().width(),
-frameview()->scrollOffset().height());
ReportFindInPageSelection(
- webkit_glue::FromIntRect(
+ webkit_glue::IntRectToWebRect(
frame()->view()->convertToContainingWindow(result_bounds)),
- active_match_index_ + 1,
- request_id);
+ active_match_index_ + 1,
+ request_id);
#endif
}
}
@@ -1547,9 +1551,8 @@ void WebFrameImpl::CreateFrameView() {
WebCore::FrameView* view;
if (is_main_frame) {
- IntSize initial_size(
- webview_impl_->size().width(), webview_impl_->size().height());
- view = new FrameView(frame_, initial_size);
+ IntSize size = webkit_glue::WebSizeToIntSize(webview_impl_->size());
+ view = new FrameView(frame_, size);
} else {
view = new FrameView(frame_);
}
@@ -1594,12 +1597,12 @@ void WebFrameImpl::Layout() {
FromFrame(child)->Layout();
}
-void WebFrameImpl::Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect) {
+void WebFrameImpl::Paint(skia::PlatformCanvas* canvas, const WebRect& rect) {
static StatsRate rendering("WebFramePaintTime");
StatsScope<StatsRate> rendering_scope(rendering);
- if (!rect.IsEmpty()) {
- IntRect dirty_rect(rect.x(), rect.y(), rect.width(), rect.height());
+ if (!rect.isEmpty()) {
+ IntRect dirty_rect(webkit_glue::WebRectToIntRect(rect));
#if defined(OS_MACOSX)
CGContextRef context = canvas->getTopPlatformDevice().GetBitmapContext();
GraphicsContext gc(context);
@@ -1875,28 +1878,28 @@ void WebFrameImpl::ClosePage() {
frame_->loader()->closeURL();
}
-gfx::Size WebFrameImpl::ScrollOffset() const {
+WebSize WebFrameImpl::ScrollOffset() const {
WebCore::FrameView* view = frameview();
if (view) {
WebCore::IntSize s = view->scrollOffset();
- return gfx::Size(s.width(), s.height());
+ return WebSize(s.width(), s.height());
}
- return gfx::Size();
+ return WebSize();
}
void WebFrameImpl::SetAllowsScrolling(bool flag) {
frame_->view()->setCanHaveScrollbars(flag);
}
-bool WebFrameImpl::BeginPrint(const gfx::Size& page_size_px,
+bool WebFrameImpl::BeginPrint(const WebSize& page_size_px,
int* page_count) {
DCHECK_EQ(frame()->document()->isFrameSet(), false);
print_context_.reset(new ChromePrintContext(frame()));
WebCore::FloatRect rect(0, 0,
- static_cast<float>(page_size_px.width()),
- static_cast<float>(page_size_px.height()));
+ static_cast<float>(page_size_px.width),
+ static_cast<float>(page_size_px.height));
print_context_->begin(rect.width());
float page_height;
// We ignore the overlays calculation for now since they are generated in the