Commit 747fe3bf authored by andersca@apple.com's avatar andersca@apple.com

Add WKWebView class

https://bugs.webkit.org/show_bug.cgi?id=127444
<rdar://problem/15884418>

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKWebView.h: Added.
* UIProcess/API/Cocoa/WKWebView.mm: Added.
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView configuration]):
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cb83ac5c
2014-01-22 Anders Carlsson <andersca@apple.com>
Add WKWebView class
https://bugs.webkit.org/show_bug.cgi?id=127444
<rdar://problem/15884418>
Reviewed by Dan Bernstein.
* UIProcess/API/Cocoa/WKWebView.h: Added.
* UIProcess/API/Cocoa/WKWebView.mm: Added.
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView configuration]):
* WebKit2.xcodeproj/project.pbxproj:
2014-01-22 Anders Carlsson <andersca@apple.com>
Fix 32-bit build.
......
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <Foundation/Foundation.h>
#import <WebKit2/WKFoundation.h>
#if WK_API_ENABLED
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <AppKit/AppKit.h>
#endif
@class WKWebViewConfiguration;
/*!
A @link WKWebView @/link displays interactive Web content.
@helperclass @link WKWebViewConfiguration @/link
Used to configure @link WKWebView @/link instances.
*/
#if TARGET_OS_IPHONE
@interface WKWebView : UIView
#else
@interface WKWebView : NSView
#endif
/*! @abstract A copy of the configuration with which the @link WKWebView @/link was initialized. */
@property (nonatomic, readonly) WKWebViewConfiguration *configuration;
/*! @abstract Returns a view initialized with the specified frame and configuration.
@param frame The frame for the new view.
@param configuration The configuration for the new view.
@result An initialized view, or nil if the object could not be initialized.
@discussion This is a designated initializer. You can use @link -initWithFrame: @/link to
initialize an instance with the default configuration.
The initializer copies
@link //apple_ref/doc/methodparam/WKWebView/initWithFrame:configuration:/configuration
configuration@/link, so mutating it after initialization has no effect on the
@link WKWebView @/link instance.
*/
- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration WK_DESIGNATED_INITIALIZER;
@end
#endif
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#import "config.h"
#import "WKWebView.h"
#if WK_API_ENABLED
#import <wtf/RetainPtr.h>
@implementation WKWebView {
RetainPtr<WKWebViewConfiguration> _configuration;
}
// FIXME: Add an initWithFrame: overload that creates a default configuration.
- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration
{
if (!(self = [super initWithFrame:frame]))
return nil;
// FIXME: Fill in nil properties with concrete properties.
_configuration = adoptNS([configuration copy]);
// FIXME: Initialize the WKWebView object.
return self;
}
- (WKWebViewConfiguration *)configuration
{
return [[_configuration copy] autorelease];
}
@end
#endif // WK_API_ENABLED
......@@ -142,6 +142,8 @@
1A30EAC6115D7DA30053E937 /* ConnectionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A30EAC5115D7DA30053E937 /* ConnectionMac.cpp */; };
1A334DED16DE8F88006A8E38 /* StorageAreaMapMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A334DEB16DE8F88006A8E38 /* StorageAreaMapMessageReceiver.cpp */; };
1A334DEE16DE8F88006A8E38 /* StorageAreaMapMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A334DEC16DE8F88006A8E38 /* StorageAreaMapMessages.h */; };
1A3CC16618906ACF001E6ED8 /* WKWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3CC16418906ACF001E6ED8 /* WKWebView.mm */; };
1A3CC16718906ACF001E6ED8 /* WKWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3CC16518906ACF001E6ED8 /* WKWebView.h */; };
1A3D610113A7CC2A00F95D4E /* PluginModuleInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3D60FF13A7CC2A00F95D4E /* PluginModuleInfo.cpp */; };
1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3D610013A7CC2A00F95D4E /* PluginModuleInfo.h */; };
1A3D610513A7F03A00F95D4E /* ArgumentCoders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3D610413A7F03A00F95D4E /* ArgumentCoders.cpp */; };
......@@ -1759,6 +1761,8 @@
1A334DEA16DE8B68006A8E38 /* StorageAreaMap.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = StorageAreaMap.messages.in; sourceTree = "<group>"; };
1A334DEB16DE8F88006A8E38 /* StorageAreaMapMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageAreaMapMessageReceiver.cpp; sourceTree = "<group>"; };
1A334DEC16DE8F88006A8E38 /* StorageAreaMapMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageAreaMapMessages.h; sourceTree = "<group>"; };
1A3CC16418906ACF001E6ED8 /* WKWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebView.mm; sourceTree = "<group>"; };
1A3CC16518906ACF001E6ED8 /* WKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebView.h; sourceTree = "<group>"; };
1A3D60FF13A7CC2A00F95D4E /* PluginModuleInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginModuleInfo.cpp; sourceTree = "<group>"; };
1A3D610013A7CC2A00F95D4E /* PluginModuleInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginModuleInfo.h; sourceTree = "<group>"; };
1A3D610413A7F03A00F95D4E /* ArgumentCoders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArgumentCoders.cpp; sourceTree = "<group>"; };
......@@ -4220,6 +4224,8 @@
1A43E828188F3CDC009E4D30 /* WKProcessClassConfiguration.h */,
1A43E827188F3CDC009E4D30 /* WKProcessClassConfiguration.mm */,
1A43E82B188F3CF5009E4D30 /* WKProcessClassConfigurationPrivate.h */,
1A3CC16518906ACF001E6ED8 /* WKWebView.h */,
1A3CC16418906ACF001E6ED8 /* WKWebView.mm */,
1ADF59191890528E0043C145 /* WKWebViewConfiguration.h */,
1ADF59181890528E0043C145 /* WKWebViewConfiguration.mm */,
);
......@@ -6442,6 +6448,7 @@
51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */,
BCCF6ABD12C91EF9008F9C35 /* WebImage.h in Headers */,
1C8E28201275D15400BC7BD0 /* WebInspector.h in Headers */,
1A3CC16718906ACF001E6ED8 /* WKWebView.h in Headers */,
BC032D8210F4378D0058C15A /* WebInspectorClient.h in Headers */,
1C8E25A91270E3BC00BC7BD0 /* WebInspectorFrontendClient.h in Headers */,
1C8E2A361277852400BC7BD0 /* WebInspectorMessages.h in Headers */,
......@@ -7642,6 +7649,7 @@
7C135AAC173B0CFF00586AE2 /* PluginInformationMac.mm in Sources */,
1AEFCC1311D01F96008219D3 /* PluginInfoStore.cpp in Sources */,
1AEFCCBD11D02C5E008219D3 /* PluginInfoStoreMac.mm in Sources */,
1A3CC16618906ACF001E6ED8 /* WKWebView.mm in Sources */,
1A3D610113A7CC2A00F95D4E /* PluginModuleInfo.cpp in Sources */,
1A043977124D034800FFBFB5 /* PluginProcess.cpp in Sources */,
1A0EC907124C0AB8007EF4A5 /* PluginProcessConnection.cpp in Sources */,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment