diff options
author | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-05 16:26:42 +0000 |
---|---|---|
committer | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-05 16:26:42 +0000 |
commit | bcc4445bdeb0b9b07e406aaea6d7256fd2139b02 (patch) | |
tree | 91a6a948bb218e9215b5b618ddd86cce17ad3944 | |
parent | 5440acdce707c3ac0b6bd1d4d8f9c07c85713aec (diff) | |
download | chromium_src-bcc4445bdeb0b9b07e406aaea6d7256fd2139b02.zip chromium_src-bcc4445bdeb0b9b07e406aaea6d7256fd2139b02.tar.gz chromium_src-bcc4445bdeb0b9b07e406aaea6d7256fd2139b02.tar.bz2 |
pick up another forked file in pending/kjs, if-def scrollView and bitmap usage in webframe until we're ready to tackle it.
Review URL: http://codereview.chromium.org/248
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1780 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/webframe_impl.cc | 36 | ||||
-rw-r--r-- | webkit/webkit.xcodeproj/project.pbxproj | 2 |
2 files changed, 37 insertions, 1 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 228b11e..e5d42ae 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -77,6 +77,8 @@ #include "config.h" +#include "build/build_config.h" + #include <algorithm> #include <string> @@ -105,7 +107,9 @@ #include "RenderWidget.h" #include "ReplaceSelectionCommand.h" #include "ResourceHandle.h" +#if defined(OS_WIN) #include "ResourceHandleWin.h" +#endif #include "ResourceRequest.h" #include "SelectionController.h" #include "Settings.h" @@ -118,9 +122,11 @@ #pragma warning(pop) #undef LOG +#if defined(OS_WIN) #include "base/gfx/bitmap_platform_device_win.h" +#endif #include "base/gfx/rect.h" -#include "base/gfx/platform_canvas_win.h" +#include "base/gfx/platform_canvas.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/stats_counters.h" @@ -718,6 +724,8 @@ void WebFrameImpl::InvalidateArea(AreaToInvalidate area) { ASSERT(frame() && frame()->view()); FrameView* view = frame()->view(); +#if defined(OS_WIN) + // TODO(pinkerton): Fix Mac invalidation to be more like Win ScrollView if ((area & INVALIDATE_ALL) == INVALIDATE_ALL) { view->addToDirtyRegion(view->frameGeometry()); } else { @@ -738,15 +746,19 @@ void WebFrameImpl::InvalidateArea(AreaToInvalidate area) { view->addToDirtyRegion(scroll_bar_vert); } } +#endif } void WebFrameImpl::InvalidateTickmark(RefPtr<WebCore::Range> tickmark) { ASSERT(frame() && frame()->view()); FrameView* view = frame()->view(); +#if defined(OS_WIN) + // TODO(pinkerton): Fix Mac invalidation to be more like Win ScrollView IntRect pos = tickmark->boundingBox(); pos.move(-view->contentsX(), -view->contentsY()); view->addToDirtyRegion(pos); +#endif } void WebFrameImpl::IncreaseMatchCount(int count, int request_id) { @@ -818,6 +830,8 @@ bool WebFrameImpl::Find(const FindInPageRequest& request, active_selection_rect_ = new_selection.toRange()->boundingBox(); ClearSelection(); // We'll draw our own highlight for the active item. +#if defined(OS_WIN) + // TODO(pinkerton): Fix Mac scrolling to be more like Win ScrollView if (selection_rect) { gfx::Rect rect( frame()->view()->convertToContainingWindow(active_selection_rect_)); @@ -825,6 +839,7 @@ bool WebFrameImpl::Find(const FindInPageRequest& request, -frameview()->scrollOffset().height()); *selection_rect = rect; } +#endif } } @@ -919,6 +934,8 @@ bool WebFrameImpl::FindNext(const FindInPageRequest& request, last_active_range_ = tickmarks_[active_tickmark_]; ClearSelection(); // We will draw our own highlighting. +#if defined(OS_WIN) + // TODO(pinkerton): Fix Mac invalidation to be more like Win ScrollView // Notify browser of new location for the selected rectangle. IntRect pos = tickmarks_[active_tickmark_]->boundingBox(); pos.move(-frameview()->scrollOffset().width(), @@ -927,6 +944,7 @@ bool WebFrameImpl::FindNext(const FindInPageRequest& request, gfx::Rect(frame()->view()->convertToContainingWindow(pos)), active_tickmark_ + 1, request.request_id); +#endif return true; // Found a match. } @@ -1114,6 +1132,8 @@ void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, // To stop looking for the active tickmark, we clear this rectangle. active_selection_rect_ = IntRect(); +#if defined(OS_WIN) + // TODO(pinkerton): Fix Mac invalidation to be more like Win ScrollView // Notify browser of new location for the selected rectangle. IntRect pos = tickmarks_[active_tickmark_]->boundingBox(); pos.move(-frameview()->scrollOffset().width(), @@ -1122,6 +1142,7 @@ void WebFrameImpl::ScopeStringMatches(FindInPageRequest request, gfx::Rect(frame()->view()->convertToContainingWindow(pos)), active_tickmark_ + 1, request.request_id); +#endif } timeout = (Time::Now() - start_time).InMilliseconds() >= kTimeout; @@ -1208,6 +1229,7 @@ void WebFrameImpl::Cut() { d->UserMetricsRecordAction(L"Cut"); } +#if defined(OS_WIN) // Returns a copy of data from a data handle retrieved from the clipboard. The // data is decoded according to the format that it is in. The caller is // responsible for freeing the data. @@ -1249,6 +1271,7 @@ static wchar_t* GetDataFromHandle(HGLOBAL data_handle, } return NULL; } +#endif void WebFrameImpl::Paste() { frame()->editor()->paste(); @@ -1299,10 +1322,13 @@ void WebFrameImpl::CreateFrameView() { DCHECK(page->mainFrame() != NULL); +#if defined(OS_WIN) + // TODO(pinkerton): figure out view show/hide like win // Detach the current view. This ensures that UI widgets like plugins, // etc are detached(hidden) if (frame_->view()) frame_->view()->detachFromWindow(); +#endif frame_->setView(0); @@ -1310,9 +1336,11 @@ void WebFrameImpl::CreateFrameView() { frame_->setView(view); +#if defined(OS_WIN) // Attaching the view ensures that UI widgets like plugins, display/hide // correctly. frame_->view()->attachToWindow(); +#endif if (margin_width_ >= 0) view->setMarginWidth(margin_width_); @@ -1381,6 +1409,8 @@ void WebFrameImpl::Paint(gfx::PlatformCanvas* canvas, const gfx::Rect& rect) { } } +#if defined(OS_WIN) +// TODO(pinkerton): waiting on bitmap re-factor from awalker gfx::BitmapPlatformDeviceWin WebFrameImpl::CaptureImage(bool scroll_to_zero) { // Must layout before painting. Layout(); @@ -1397,6 +1427,7 @@ gfx::BitmapPlatformDeviceWin WebFrameImpl::CaptureImage(bool scroll_to_zero) { device.fixupAlphaBeforeCompositing(); return device; } +#endif bool WebFrameImpl::IsLoading() { // I'm assuming this does what we want. @@ -1650,7 +1681,10 @@ gfx::Size WebFrameImpl::ScrollOffset() const { void WebFrameImpl::SetAllowsScrolling(bool flag) { allows_scrolling_ = flag; +#if defined(OS_WIN) + // TODO(pinkerton): fix when we figure out scrolling apis frame_->view()->setAllowsScrolling(flag); +#endif } bool WebFrameImpl::SetPrintingMode(bool printing, diff --git a/webkit/webkit.xcodeproj/project.pbxproj b/webkit/webkit.xcodeproj/project.pbxproj index 130b72b..3d00b5c 100644 --- a/webkit/webkit.xcodeproj/project.pbxproj +++ b/webkit/webkit.xcodeproj/project.pbxproj @@ -11487,6 +11487,7 @@ "$(CONFIGURATION_BUILD_DIR)/WebCore/v8", "$(CONFIGURATION_BUILD_DIR)/include/v8", pending, + pending/kjs, ../v8/include, ../third_party/WebKit/WebCore, ../third_party/WebKit/JavaScriptCore, @@ -11532,6 +11533,7 @@ "$(CONFIGURATION_BUILD_DIR)/WebCore/v8", "$(CONFIGURATION_BUILD_DIR)/include/v8", pending, + pending/kjs, ../v8/include, ../third_party/WebKit/WebCore, ../third_party/WebKit/JavaScriptCore, |