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

Unified Diff: webkit/glue/webframe_impl.cc

Issue 7244: Linux build fixes for webframe_imple.cc (Closed)
Patch Set: Linux build fixes for webframe_imple.cc Created 12 years, 2 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
« no previous file with comments | « base/gfx/rect.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webframe_impl.cc
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index 113cceeab98ad660b4b4a3336d5d618d25f4b726..3c001b1a9d4c6b636cef437e2956415482586872 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -106,7 +106,9 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "HistoryItem.h"
#include "markup.h"
#include "Page.h"
+#if defined(OS_WIN)
#include "PlatformScrollBar.h"
+#endif
#include "RenderFrame.h"
#include "RenderWidget.h"
#include "ReplaceSelectionCommand.h"
@@ -124,6 +126,10 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "TextAffinity.h"
#include "XPathResult.h"
+#if defined(OS_LINUX)
+#include <gdk/gdk.h>
+#endif
+
MSVC_POP_WARNING();
#undef LOG
@@ -245,7 +251,6 @@ static void FrameContentAsPlainText(int max_chars, Frame* frame,
// Recursively walk the children.
FrameTree* frame_tree = frame->tree();
- Frame* cur_child = frame_tree->firstChild();
for (Frame* cur_child = frame_tree->firstChild(); cur_child;
cur_child = cur_child->tree()->nextSibling()) {
// Make sure the frame separator won't fill up the buffer, and give up if
@@ -271,23 +276,23 @@ WebFrameImpl::WebFrameImpl()
// Don't complain about using "this" in initializer list.
MSVC_PUSH_DISABLE_WARNING(4355)
: frame_loader_client_(this),
- scope_matches_factory_(this),
-MSVC_POP_WARNING()
currently_loading_request_(NULL),
plugin_delegate_(NULL),
allows_scrolling_(true),
margin_width_(-1),
margin_height_(-1),
- last_match_count_(-1),
- total_matchcount_(-1),
inspected_node_(NULL),
- active_tickmark_frame_(NULL),
active_tickmark_(WidgetClientWin::kNoTickmark),
locating_active_rect_(false),
last_active_range_(NULL),
+ last_match_count_(-1),
+ total_matchcount_(-1),
+ active_tickmark_frame_(NULL),
frames_scoping_count_(-1),
scoping_complete_(false),
next_invalidate_after_(0),
+ scope_matches_factory_(this),
+MSVC_POP_WARNING()
printing_(false) {
StatsCounter(kWebFrameActiveCount).Increment();
live_object_count_++;
@@ -724,9 +729,9 @@ void WebFrameImpl::GetContentAsPlainText(int max_chars,
void WebFrameImpl::InvalidateArea(AreaToInvalidate area) {
ASSERT(frame() && frame()->view());
- FrameView* view = frame()->view();
#if defined(OS_WIN)
+ FrameView* view = frame()->view();
// TODO(pinkerton): Fix Mac invalidation to be more like Win ScrollView
if ((area & INVALIDATE_ALL) == INVALIDATE_ALL) {
view->addToDirtyRegion(view->frameGeometry());
@@ -753,9 +758,9 @@ void WebFrameImpl::InvalidateArea(AreaToInvalidate area) {
void WebFrameImpl::InvalidateTickmark(RefPtr<WebCore::Range> tickmark) {
ASSERT(frame() && frame()->view());
- FrameView* view = frame()->view();
#if defined(OS_WIN)
+ FrameView* view = frame()->view();
// TODO(pinkerton): Fix Mac invalidation to be more like Win ScrollView
IntRect pos = tickmark->boundingBox();
pos.move(-view->contentsX(), -view->contentsY());
@@ -1492,45 +1497,32 @@ void WebFrameImpl::Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) {
}
}
-#if defined(OS_WIN)
gfx::BitmapPlatformDevice WebFrameImpl::CaptureImage(bool scroll_to_zero) {
// Must layout before painting.
Layout();
-
- gfx::PlatformCanvasWin canvas(frameview()->width(), frameview()->height(), true);
+ gfx::PlatformCanvas canvas(frameview()->width(),
+ frameview()->height(), true);
+#if defined(OS_WIN) || defined(OS_LINUX)
PlatformContextSkia context(&canvas);
GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context));
frameview()->paint(&gc, IntRect(0, 0, frameview()->width(),
- frameview()->height()));
-
- gfx::BitmapPlatformDeviceWin& device =
- static_cast<gfx::BitmapPlatformDeviceWin&>(canvas.getTopPlatformDevice());
- device.fixupAlphaBeforeCompositing();
- return device;
-}
+ frameview()->height()));
#elif defined(OS_MACOSX)
-gfx::BitmapPlatformDevice WebFrameImpl::CaptureImage(bool scroll_to_zero) {
- // Must layout before painting.
- Layout();
-
- gfx::PlatformCanvasMac canvas(frameview()->width(),
- frameview()->height(), true);
CGContextRef context = canvas.beginPlatformPaint();
GraphicsContext gc(context);
frameview()->paint(&gc, IntRect(0, 0, frameview()->width(),
frameview()->height()));
canvas.endPlatformPaint();
+#endif
gfx::BitmapPlatformDevice& device =
static_cast<gfx::BitmapPlatformDevice&>(canvas.getTopPlatformDevice());
+#if defined(OS_WIN)
+ device.fixupAlphaBeforeCompositing();
+#endif
return device;
}
-#else
-gfx::BitmapPlatformDevice WebFrameImpl::CaptureImage(bool scroll_to_zero) {
- NOTIMPLEMENTED();
-}
-#endif
bool WebFrameImpl::IsLoading() {
// I'm assuming this does what we want.
@@ -1843,8 +1835,7 @@ void WebFrameImpl::GetPageRect(int page, gfx::Rect* page_size) const {
*page_size = pages_[page];
}
-bool WebFrameImpl::SpoolPage(int page,
- PlatformContextSkia* context) {
+bool WebFrameImpl::SpoolPage(int page, PlatformContextSkia* context) {
// Ensure correct state.
if (!context ||
!printing_ ||
« no previous file with comments | « base/gfx/rect.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698