Changeset 70561 in webkit
- Timestamp:
- Oct 26, 2010 1:16:18 PM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r70548 r70561 1 2010-10-26 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Need a way to retrieve custom user agent from a WKPage 6 https://bugs.webkit.org/show_bug.cgi?id=48360 7 <rdar://problem/8466537> 8 9 Add an exported function on WKPage to get the page's custom user agent. 10 11 * UIProcess/API/C/WKPage.cpp: 12 (WKPageCopyCustomUserAgent): Exported function that returns the custom user 13 agent. 14 * UIProcess/API/C/WKPage.h: 15 * UIProcess/WebPageProxy.cpp: 16 (WebKit::WebPageProxy::close): Clear the custom user agent string. 17 (WebKit::WebPageProxy::processDidCrash): Ditto. 18 (WebKit::WebPageProxy::setCustomUserAgent): Add a new early return if we're setting 19 the custom user agent to what it was before, and set the custom user agent member 20 variable. 21 * UIProcess/WebPageProxy.h: 22 (WebKit::WebPageProxy::customUserAgent): Returns the custom user agent. 23 1 24 2010-10-26 Simon Fraser <simon.fraser@apple.com> 2 25 -
trunk/WebKit2/UIProcess/API/C/WKPage.cpp
r70504 r70561 153 153 } 154 154 155 WKStringRef WKPageCopyCustomUserAgent(WKPageRef pageRef) 156 { 157 return toCopiedAPI(toImpl(pageRef)->customUserAgent()); 158 } 159 155 160 void WKPageSetCustomUserAgent(WKPageRef pageRef, WKStringRef userAgentRef) 156 161 { -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r70510 r70561 215 215 WK_EXPORT WKInspectorRef WKPageGetInspector(WKPageRef page); 216 216 217 WK_EXPORT WKStringRef WKPageCopyCustomUserAgent(WKPageRef page); 217 218 WK_EXPORT void WKPageSetCustomUserAgent(WKPageRef page, WKStringRef userAgent); 218 219 -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r70504 r70561 187 187 m_mainFrame = 0; 188 188 189 m_customUserAgent = String(); 189 190 m_pageTitle = String(); 190 191 m_toolTip = String(); … … 458 459 return; 459 460 461 if (m_customUserAgent == userAgent || (m_customUserAgent.isEmpty() && userAgent.isEmpty())) 462 return; 463 464 m_customUserAgent = userAgent; 460 465 process()->send(Messages::WebPage::SetCustomUserAgent(userAgent), m_pageID); 461 466 } … … 1179 1184 } 1180 1185 1186 m_customUserAgent = String(); 1181 1187 m_pageTitle = String(); 1182 1188 m_toolTip = String(); -
trunk/WebKit2/UIProcess/WebPageProxy.h
r70504 r70561 167 167 const String& pageTitle() const { return m_pageTitle; } 168 168 const String& toolTip() const { return m_toolTip; } 169 const String& customUserAgent() const { return m_customUserAgent; } 169 170 170 171 double estimatedProgress() const { return m_estimatedProgress; } … … 328 329 String m_pageTitle; 329 330 331 String m_customUserAgent; 332 330 333 RefPtr<WebInspectorProxy> m_inspector; 331 334
Note: See TracChangeset
for help on using the changeset viewer.