Changeset 74275 in webkit
- Timestamp:
- Dec 17, 2010 9:57:44 AM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r74268 r74275 1 2010-12-16 Darin Adler <darin@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 Add text encoding menu API for WebKit2 6 https://bugs.webkit.org/show_bug.cgi?id=51226 7 8 * UIProcess/API/C/WKPage.cpp: 9 (WKPageSupportsTextEncoding): Added. 10 (WKPageCopyCustomTextEncodingName): Added. 11 (WKPageSetCustomTextEncodingName): Added. 12 * UIProcess/API/C/WKPage.h: Added the functions above. 13 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::WebPageProxy::WebPageProxy): Initialize 16 m_mainFrameHasCustomRepresentation to false. 17 (WebKit::WebPageProxy::supportsTextEncoding): Added. 18 (WebKit::WebPageProxy::setCustomTextEncodingName): Added. 19 (WebKit::WebPageProxy::didCommitLoadForFrame): Set 20 m_mainFrameHasCustomRepresentation. 21 22 * UIProcess/WebPageProxy.h: Added supportsTextEncoding, 23 setCustomTextEncodingName, customTextEncodingName, and 24 m_mainFrameHasCustomRepresentation. 25 26 * UIProcess/WebPageProxy.messages.in: Tweaked formatting 27 (added a blank line). 28 29 * WebProcess/WebPage/WebPage.cpp: 30 (WebKit::WebPage::setCustomTextEncodingName): Added. 31 * WebProcess/WebPage/WebPage.h: Added setCustomTextEncodingName. 32 33 * WebProcess/WebPage/WebPage.messages.in: Added the 34 SetCustomTextEncodingName message. Tweaked formatting of the 35 dummy message. 36 1 37 2010-12-17 Sheriff Bot <webkit.review.bot@gmail.com> 2 38 -
trunk/WebKit2/UIProcess/API/C/WKPage.cpp
r74000 r74275 190 190 } 191 191 192 bool WKPageSupportsTextEncoding(WKPageRef pageRef) 193 { 194 return toImpl(pageRef)->supportsTextEncoding(); 195 } 196 197 WKStringRef WKPageCopyCustomTextEncodingName(WKPageRef pageRef) 198 { 199 return toCopiedAPI(toImpl(pageRef)->customTextEncodingName()); 200 } 201 202 void WKPageSetCustomTextEncodingName(WKPageRef pageRef, WKStringRef encodingNameRef) 203 { 204 toImpl(pageRef)->setCustomTextEncodingName(toWTFString(encodingNameRef)); 205 } 206 192 207 void WKPageTerminate(WKPageRef pageRef) 193 208 { -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r74139 r74275 261 261 WK_EXPORT void WKPageSetCustomUserAgent(WKPageRef page, WKStringRef userAgent); 262 262 263 WK_EXPORT bool WKPageSupportsTextEncoding(WKPageRef page); 264 WK_EXPORT WKStringRef WKPageCopyCustomTextEncodingName(WKPageRef page); 265 WK_EXPORT void WKPageSetCustomTextEncodingName(WKPageRef page, WKStringRef encodingName); 266 263 267 WK_EXPORT void WKPageTerminate(WKPageRef page); 264 268 -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r74164 r74275 109 109 , m_processingWheelEvent(false) 110 110 , m_pageID(pageID) 111 , m_mainFrameHasCustomRepresentation(false) 111 112 { 112 113 #ifndef NDEBUG … … 661 662 } 662 663 664 bool WebPageProxy::supportsTextEncoding() const 665 { 666 return !m_mainFrameHasCustomRepresentation && m_mainFrame && !m_mainFrame->isDisplayingStandaloneImageDocument(); 667 } 668 669 void WebPageProxy::setCustomTextEncodingName(const String& encodingName) 670 { 671 if (m_customTextEncodingName == encodingName) 672 return; 673 m_customTextEncodingName = encodingName; 674 675 if (!isValid()) 676 return; 677 process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID); 678 } 679 663 680 void WebPageProxy::terminateProcess() 664 681 { … … 931 948 frame->didCommitLoad(); 932 949 933 if (frame->isMainFrame()) 950 if (frame->isMainFrame()) { 951 m_mainFrameHasCustomRepresentation = frameHasCustomRepresentation; 934 952 m_pageClient->didCommitLoadForMainFrame(frameHasCustomRepresentation); 953 } 935 954 936 955 m_loaderClient.didCommitLoadForFrame(this, frame, userData.get()); -
trunk/WebKit2/UIProcess/WebPageProxy.h
r74164 r74275 180 180 WebCore::IntRect firstRectForCharacterRange(uint64_t, uint64_t); 181 181 void didSelectionChange(bool, bool, bool, bool, uint64_t, uint64_t); 182 183 182 void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String& textInput); 184 185 183 #else 186 184 void didChangeSelection(bool, bool, bool, bool); … … 213 211 void setCustomUserAgent(const String&); 214 212 const String& customUserAgent() const { return m_customUserAgent; } 213 214 bool supportsTextEncoding() const; 215 void setCustomTextEncodingName(const String&); 216 String customTextEncodingName() const { return m_customTextEncodingName; } 215 217 216 218 double estimatedProgress() const { return m_estimatedProgress; } … … 439 441 String m_applicationNameForUserAgent; 440 442 String m_customUserAgent; 443 String m_customTextEncodingName; 441 444 442 445 #if ENABLE(INSPECTOR) … … 492 495 493 496 uint64_t m_pageID; 497 498 bool m_mainFrameHasCustomRepresentation; 494 499 }; 495 500 -
trunk/WebKit2/UIProcess/WebPageProxy.messages.in
r74224 r74275 132 132 DidChangeCompositionSelection(bool hasChanged) 133 133 #endif 134 134 135 # Find. 135 136 DidCountStringMatches(WTF::String string, uint32_t matchCount) -
trunk/WebKit2/WebProcess/WebPage/WebPage.cpp
r74209 r74275 1302 1302 } 1303 1303 1304 void WebPage::setCustomTextEncodingName(const String& encoding) 1305 { 1306 m_page->mainFrame()->loader()->reloadWithOverrideEncoding(encoding); 1307 } 1308 1304 1309 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebPage/WebPage.h
r74164 r74275 318 318 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID); 319 319 void setUserAgent(const String&); 320 void setCustomTextEncodingName(const String&); 320 321 321 322 #if PLATFORM(MAC) -
trunk/WebKit2/WebProcess/WebPage/WebPage.messages.in
r74224 r74275 58 58 59 59 SetUserAgent(WTF::String userAgent) 60 SetCustomTextEncodingName(WTF::String encodingName) 60 61 61 62 #if ENABLE(TILED_BACKING_STORE) … … 97 98 SetWindowResizerSize(WebCore::IntSize intersectsView) 98 99 99 // This is a dummy message to avoid breaking the build for platforms that don't require 100 // synchronous messages. 101 // FIXME: should be removed when <rdar://problem/8775115> is fixed. 102 Dummy() -> (bool dummyReturn) 103 100 // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require 101 // any synchronous messages, and should be removed when <rdar://problem/8775115> is fixed. 102 Dummy() -> (bool dummyReturn) 103 104 104 #if PLATFORM(MAC) 105 105 # Complex text input support for plug-ins.
Note: See TracChangeset
for help on using the changeset viewer.