diff options
author | Iain Merrick <husky@google.com> | 2010-09-13 16:35:48 +0100 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-09-16 12:10:42 +0100 |
commit | 5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 (patch) | |
tree | ddce1aa5e3b6967a69691892e500897558ff8ab6 /WebCore/platform/win | |
parent | 12bec63ec71e46baba27f0bd9bd9d8067683690a (diff) | |
download | external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.zip external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.gz external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.bz2 |
Merge WebKit at r67178 : Initial merge by git.
Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18
Diffstat (limited to 'WebCore/platform/win')
-rw-r--r-- | WebCore/platform/win/ClipboardWin.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/win/PasteboardWin.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/win/PopupMenuWin.cpp | 15 | ||||
-rw-r--r-- | WebCore/platform/win/PopupMenuWin.h | 2 | ||||
-rw-r--r-- | WebCore/platform/win/ScrollbarThemeWin.cpp | 16 |
5 files changed, 26 insertions, 11 deletions
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp index 2915f9d..6d9930c 100644 --- a/WebCore/platform/win/ClipboardWin.cpp +++ b/WebCore/platform/win/ClipboardWin.cpp @@ -776,7 +776,7 @@ void ClipboardWin::writeRange(Range* selectedRange, Frame* frame) if (medium.hGlobal && FAILED(m_writableDataObject->SetData(htmlFormat(), &medium, TRUE))) ::GlobalFree(medium.hGlobal); - String str = frame->selectedText(); + String str = frame->editor()->selectedText(); replaceNewlinesWithWindowsStyleNewlines(str); replaceNBSPWithSpace(str); medium.hGlobal = createGlobalData(str); diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp index c065f04..4b20adb 100644 --- a/WebCore/platform/win/PasteboardWin.cpp +++ b/WebCore/platform/win/PasteboardWin.cpp @@ -131,7 +131,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, } // Put plain string on the pasteboard. CF_UNICODETEXT covers CF_TEXT as well - String str = frame->selectedText(); + String str = frame->editor()->selectedText(); replaceNewlinesWithWindowsStyleNewlines(str); replaceNBSPWithSpace(str); if (::OpenClipboard(m_owner)) { diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp index 6e22024..a782b03 100644 --- a/WebCore/platform/win/PopupMenuWin.cpp +++ b/WebCore/platform/win/PopupMenuWin.cpp @@ -531,12 +531,12 @@ bool PopupMenuWin::scrollToRevealSelection() int index = focusedIndex(); if (index < m_scrollOffset) { - m_scrollbar->setValue(index); + m_scrollbar->setValue(index, Scrollbar::NotFromScrollAnimator); return true; } if (index >= m_scrollOffset + visibleItems()) { - m_scrollbar->setValue(index - visibleItems() + 1); + m_scrollbar->setValue(index - visibleItems() + 1, Scrollbar::NotFromScrollAnimator); return true; } @@ -664,6 +664,17 @@ void PopupMenuWin::paint(const IntRect& damageRect, HDC hdc) ::ReleaseDC(m_popup, localDC); } +int PopupMenuWin::scrollSize(ScrollbarOrientation orientation) const +{ + return ((orientation == VerticalScrollbar) && m_scrollbar) ? (m_scrollbar->totalSize() - m_scrollbar->visibleSize()) : 0; +} + +void PopupMenuWin::setScrollOffsetFromAnimation(const IntPoint& offset) +{ + if (m_scrollbar) + m_scrollbar->setValue(offset.y(), Scrollbar::FromScrollAnimator); +} + void PopupMenuWin::valueChanged(Scrollbar* scrollBar) { ASSERT(m_scrollbar); diff --git a/WebCore/platform/win/PopupMenuWin.h b/WebCore/platform/win/PopupMenuWin.h index d4a4255..bfec7aa 100644 --- a/WebCore/platform/win/PopupMenuWin.h +++ b/WebCore/platform/win/PopupMenuWin.h @@ -91,6 +91,8 @@ private: void setScrollbarCapturingMouse(bool b) { m_scrollbarCapturingMouse = b; } // ScrollBarClient + virtual int scrollSize(ScrollbarOrientation orientation) const; + virtual void setScrollOffsetFromAnimation(const IntPoint&); virtual void valueChanged(Scrollbar*); virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&); virtual bool isActive() const { return true; } diff --git a/WebCore/platform/win/ScrollbarThemeWin.cpp b/WebCore/platform/win/ScrollbarThemeWin.cpp index a8d374a..ff3aaa4 100644 --- a/WebCore/platform/win/ScrollbarThemeWin.cpp +++ b/WebCore/platform/win/ScrollbarThemeWin.cpp @@ -27,6 +27,7 @@ #include "ScrollbarThemeWin.h" #include "GraphicsContext.h" +#include "LocalWindowsContext.h" #include "PlatformMouseEvent.h" #include "Scrollbar.h" #include "SoftLinking.h" @@ -240,14 +241,17 @@ void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* context, Scrollbar* scr bool alphaBlend = false; if (scrollbarTheme) alphaBlend = IsThemeBackgroundPartiallyTransparent(scrollbarTheme, part, state); - HDC hdc = context->getWindowsContext(rect, alphaBlend); + + LocalWindowsContext windowsContext(context, rect, alphaBlend); RECT themeRect(rect); + if (scrollbarTheme) - DrawThemeBackground(scrollbarTheme, hdc, part, state, &themeRect, 0); + DrawThemeBackground(scrollbarTheme, windowsContext.hdc(), part, state, &themeRect, 0); else { DWORD color3DFace = ::GetSysColor(COLOR_3DFACE); DWORD colorScrollbar = ::GetSysColor(COLOR_SCROLLBAR); DWORD colorWindow = ::GetSysColor(COLOR_WINDOW); + HDC hdc = windowsContext.hdc(); if ((color3DFace != colorScrollbar) && (colorWindow != colorScrollbar)) ::FillRect(hdc, &themeRect, HBRUSH(COLOR_SCROLLBAR+1)); else { @@ -265,7 +269,6 @@ void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* context, Scrollbar* scr ::DeleteObject(patternBitmap); } } - context->releaseWindowsContext(hdc, rect, alphaBlend); } void ScrollbarThemeWin::paintButton(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part) @@ -308,14 +311,13 @@ void ScrollbarThemeWin::paintButton(GraphicsContext* context, Scrollbar* scrollb bool alphaBlend = false; if (scrollbarTheme) alphaBlend = IsThemeBackgroundPartiallyTransparent(scrollbarTheme, SP_BUTTON, xpState); - HDC hdc = context->getWindowsContext(rect, alphaBlend); + LocalWindowsContext windowsContext(context, rect, alphaBlend); RECT themeRect(rect); if (scrollbarTheme) - DrawThemeBackground(scrollbarTheme, hdc, SP_BUTTON, xpState, &themeRect, 0); + DrawThemeBackground(scrollbarTheme, windowsContext.hdc(), SP_BUTTON, xpState, &themeRect, 0); else - ::DrawFrameControl(hdc, &themeRect, DFC_SCROLL, classicState); - context->releaseWindowsContext(hdc, rect, alphaBlend); + ::DrawFrameControl(windowsContext.hdc(), &themeRect, DFC_SCROLL, classicState); } static IntRect gripperRect(int thickness, const IntRect& thumbRect) |