Changeset 160710 in webkit


Ignore:
Timestamp:
Dec 17, 2013 9:40:07 AM (10 years ago)
Author:
mitz@apple.com
Message:

[Cocoa] Add properties related to the user agent string
https://bugs.webkit.org/show_bug.cgi?id=125856

Reviewed by Anders Carlsson.

  • UIProcess/API/Cocoa/WKBrowsingContextController.h: Declared new properties.
  • UIProcess/API/Cocoa/WKBrowsingContextController.mm:

(-[WKBrowsingContextController applicationNameForUserAgent]): Added accessor.
(-[WKBrowsingContextController setApplicationNameForUserAgent:]): Ditto.
(-[WKBrowsingContextController customUserAgent]): Ditto.
(-[WKBrowsingContextController setCustomUserAgent:]): Ditto.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r160696 r160710  
     12013-12-17  Dan Bernstein  <mitz@apple.com>
     2
     3        [Cocoa] Add properties related to the user agent string
     4        https://bugs.webkit.org/show_bug.cgi?id=125856
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/API/Cocoa/WKBrowsingContextController.h: Declared new properties.
     9        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
     10        (-[WKBrowsingContextController applicationNameForUserAgent]): Added accessor.
     11        (-[WKBrowsingContextController setApplicationNameForUserAgent:]): Ditto.
     12        (-[WKBrowsingContextController customUserAgent]): Ditto.
     13        (-[WKBrowsingContextController setCustomUserAgent:]): Ditto.
     14
    1152013-12-16  Gavin Barraclough  <barraclough@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.h

    r160626 r160710  
    9191- (void)reloadFromOrigin;
    9292
     93@property (copy) NSString *applicationNameForUserAgent;
     94@property (copy) NSString *customUserAgent;
    9395
    9496#pragma mark Back/Forward
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm

    r160662 r160710  
    281281}
    282282
     283- (NSString *)applicationNameForUserAgent
     284{
     285    const String& applicationName = _page->applicationNameForUserAgent();
     286    return !applicationName ? nil : (NSString *)applicationName;
     287}
     288
     289- (void)setApplicationNameForUserAgent:(NSString *)applicationNameForUserAgent
     290{
     291    _page->setApplicationNameForUserAgent(applicationNameForUserAgent);
     292}
     293
     294- (NSString *)customUserAgent
     295{
     296    const String& customUserAgent = _page->customUserAgent();
     297    return !customUserAgent ? nil : (NSString *)customUserAgent;
     298}
     299
     300- (void)setCustomUserAgent:(NSString *)customUserAgent
     301{
     302    _page->setCustomUserAgent(customUserAgent);
     303}
     304
    283305#pragma mark Back/Forward
    284306
Note: See TracChangeset for help on using the changeset viewer.