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

Side by Side Diff: third_party/WebKit/WebCore/platform/chromium/PopupMenuChromium.cpp

Issue 17339: Fix for the painting problem with drop down scroll bar (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/WebKit/WebCore/platform/chromium/FramelessScrollView.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 virtual void paint(GraphicsContext* gc, const IntRect& rect); 78 virtual void paint(GraphicsContext* gc, const IntRect& rect);
79 virtual bool handleMouseDownEvent(const PlatformMouseEvent& event); 79 virtual bool handleMouseDownEvent(const PlatformMouseEvent& event);
80 virtual bool handleMouseMoveEvent(const PlatformMouseEvent& event); 80 virtual bool handleMouseMoveEvent(const PlatformMouseEvent& event);
81 virtual bool handleMouseReleaseEvent(const PlatformMouseEvent& event); 81 virtual bool handleMouseReleaseEvent(const PlatformMouseEvent& event);
82 virtual bool handleWheelEvent(const PlatformWheelEvent& event); 82 virtual bool handleWheelEvent(const PlatformWheelEvent& event);
83 virtual bool handleKeyEvent(const PlatformKeyboardEvent& event); 83 virtual bool handleKeyEvent(const PlatformKeyboardEvent& event);
84 84
85 // ScrollView 85 // ScrollView
86 virtual HostWindow* hostWindow() const; 86 virtual HostWindow* hostWindow() const;
87 87
88 // Widget
89 virtual void invalidateRect(const IntRect&);
90
88 // PopupListBox methods 91 // PopupListBox methods
89 92
90 // Show the popup 93 // Show the popup
91 void showPopup(); 94 void showPopup();
92 95
93 // Hide the popup. Do not call this directly: use client->hidePopup(). 96 // Hide the popup. Do not call this directly: use client->hidePopup().
94 void hidePopup(); 97 void hidePopup();
95 98
96 // Update our internal list to match the client. 99 // Update our internal list to match the client.
97 void updateFromElement(); 100 void updateFromElement();
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 return true; 650 return true;
648 } 651 }
649 652
650 HostWindow* PopupListBox::hostWindow() const 653 HostWindow* PopupListBox::hostWindow() const
651 { 654 {
652 // Our parent is the root ScrollView, so it is the one that has a 655 // Our parent is the root ScrollView, so it is the one that has a
653 // HostWindow. FrameView::hostWindow() works similarly. 656 // HostWindow. FrameView::hostWindow() works similarly.
654 return parent() ? parent()->hostWindow() : 0; 657 return parent() ? parent()->hostWindow() : 0;
655 } 658 }
656 659
660 void PopupListBox::invalidateRect(const IntRect& rect)
661 {
662 // Since we are returning the HostWindow of our parent as our own in
663 // hostWindow(), we need to invalidate in our parent coordinates.
664 IntRect newRect(rect);
665 newRect.move(kBorderSize, kBorderSize);
666 FramelessScrollView::invalidateRect(newRect);
667 }
668
657 // From HTMLSelectElement.cpp 669 // From HTMLSelectElement.cpp
658 static String stripLeadingWhiteSpace(const String& string) 670 static String stripLeadingWhiteSpace(const String& string)
659 { 671 {
660 int length = string.length(); 672 int length = string.length();
661 int i; 673 int i;
662 for (i = 0; i < length; ++i) 674 for (i = 0; i < length; ++i)
663 if (string[i] != noBreakSpace && 675 if (string[i] != noBreakSpace &&
664 (string[i] <= 0x7F ? !isspace(string[i]) : (direction(string[i]) != WhiteSpaceNeutral))) 676 (string[i] <= 0x7F ? !isspace(string[i]) : (direction(string[i]) != WhiteSpaceNeutral)))
665 break; 677 break;
666 678
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 { 1115 {
1104 p.m_popup->listBox()->updateFromElement(); 1116 p.m_popup->listBox()->updateFromElement();
1105 } 1117 }
1106 1118
1107 bool PopupMenu::itemWritingDirectionIsNatural() 1119 bool PopupMenu::itemWritingDirectionIsNatural()
1108 { 1120 {
1109 return false; 1121 return false;
1110 } 1122 }
1111 1123
1112 } // namespace WebCore 1124 } // namespace WebCore
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/platform/chromium/FramelessScrollView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698