Commit b7f8848d authored by mitz@apple.com's avatar mitz@apple.com
Browse files

WebCore:

        Reviewed by John Sullivan.

        - WebCore part of <rdar://problem/6334641> Add WebView SPI for disabling document.cookie

        * dom/Document.cpp:
        (WebCore::Document::cookie): Added checking if cookies are disabled.
        (WebCore::Document::setCookie): Ditto.
        * page/Navigator.cpp:
        (WebCore::Navigator::cookieEnabled): Ditto.
        * page/Page.cpp:
        (WebCore::Page::Page): Initialize m_cookieEnabled to true.
        * page/Page.h:
        (WebCore::Page::cookieEnabled): Added.
        (WebCore::Page::setCookieEnabled): Added.

WebKit/mac:

        Reviewed by John Sullivan.

        - WebKit/mac part of <rdar://problem/6334641> Add WebView SPI for disabling document.cookie

        * WebView/WebView.mm:
        (-[WebView _cookieEnabled]):
        (-[WebView _setCookieEnabled:]):
        * WebView/WebViewPrivate.h:

WebKit/win:

        Reviewed by John Sullivan.

        - WebKit/win part of <rdar://problem/6334641> Add WebView SPI for disabling document.cookie

        * Interfaces/IWebViewPrivate.idl:
        * WebView.cpp:
        (WebView::setCookieEnabled):
        (WebView::cookieEnabled):
        * WebView.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ae80b36e
2008-10-31 Dan Bernstein <mitz@apple.com>
Reviewed by John Sullivan.
- WebCore part of <rdar://problem/6334641> Add WebView SPI for disabling document.cookie
* dom/Document.cpp:
(WebCore::Document::cookie): Added checking if cookies are disabled.
(WebCore::Document::setCookie): Ditto.
* page/Navigator.cpp:
(WebCore::Navigator::cookieEnabled): Ditto.
* page/Page.cpp:
(WebCore::Page::Page): Initialize m_cookieEnabled to true.
* page/Page.h:
(WebCore::Page::cookieEnabled): Added.
(WebCore::Page::setCookieEnabled): Added.
2008-10-31 Adele Peterson <adele@apple.com>
 
Reviewed by Darin Adler.
......
......@@ -2858,11 +2858,17 @@ Element* Document::ownerElement() const
String Document::cookie() const
{
if (page() && !page()->cookieEnabled())
return String();
return cookies(this, cookieURL());
}
void Document::setCookie(const String& value)
{
if (page() && !page()->cookieEnabled())
return;
setCookies(this, cookieURL(), policyBaseURL(), value);
}
......
......@@ -31,6 +31,7 @@
#include "Language.h"
#include "MimeTypeArray.h"
#include "NetworkStateNotifier.h"
#include "Page.h"
#include "PlatformString.h"
#include "PluginArray.h"
#include "PluginData.h"
......@@ -187,6 +188,9 @@ String Navigator::vendorSub() const
bool Navigator::cookieEnabled() const
{
if (m_frame->page() && !m_frame->page()->cookieEnabled())
return false;
return cookiesEnabled(m_frame->document());
}
......
......@@ -118,6 +118,7 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
, m_tabKeyCyclesThroughElements(true)
, m_defersLoading(false)
, m_inLowQualityInterpolationMode(false)
, m_cookieEnabled(true)
, m_parentInspectorController(0)
, m_didLoadUserStyleSheet(false)
, m_userStyleSheetModificationTime(0)
......
......@@ -139,6 +139,9 @@ namespace WebCore {
bool inLowQualityImageInterpolationMode() const;
void setInLowQualityImageInterpolationMode(bool = true);
bool cookieEnabled() const { return m_cookieEnabled; }
void setCookieEnabled(bool enabled) { m_cookieEnabled = enabled; }
void userStyleSheetLocationChanged();
const String& userStyleSheet() const;
......@@ -201,6 +204,7 @@ namespace WebCore {
bool m_defersLoading;
bool m_inLowQualityInterpolationMode;
bool m_cookieEnabled;
InspectorController* m_parentInspectorController;
......
2008-10-31 Dan Bernstein <mitz@apple.com>
Reviewed by John Sullivan.
- WebKit/mac part of <rdar://problem/6334641> Add WebView SPI for disabling document.cookie
* WebView/WebView.mm:
(-[WebView _cookieEnabled]):
(-[WebView _setCookieEnabled:]):
* WebView/WebViewPrivate.h:
2008-10-31 Brady Eidson <beidson@apple.com>
Reviewed by Darin Adler
......
......@@ -1867,6 +1867,19 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
return NO;
}
- (BOOL)_cookieEnabled
{
if (_private->page)
return _private->page->cookieEnabled();
return YES;
}
- (void)_setCookieEnabled:(BOOL)enable
{
if (_private->page)
_private->page->setCookieEnabled(enable);
}
- (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths
{
if (!_private->pluginDatabase)
......
......@@ -381,6 +381,9 @@ Could be worth adding to the API.
- (BOOL)_inFastImageScalingMode;
- (void)_setUseFastImageScalingMode:(BOOL)flag;
- (BOOL)_cookieEnabled;
- (void)_setCookieEnabled:(BOOL)enable;
// SPI for DumpRenderTree
- (void)_executeCoreCommandByName:(NSString *)name value:(NSString *)value;
- (void)_clearMainFrameName;
......
2008-10-31 Dan Bernstein <mitz@apple.com>
Reviewed by John Sullivan.
- WebKit/win part of <rdar://problem/6334641> Add WebView SPI for disabling document.cookie
* Interfaces/IWebViewPrivate.idl:
* WebView.cpp:
(WebView::setCookieEnabled):
(WebView::cookieEnabled):
* WebView.h:
2008-10-31 Adele Peterson <adele@apple.com>
 
Reviewed by Darin Adler.
......
......@@ -143,4 +143,7 @@ interface IWebViewPrivate : IUnknown
HRESULT setAlwaysUsesComplexTextCodePath([in] BOOL complex);
HRESULT alwaysUsesComplexTextCodePath([out, retval] BOOL* complex);
HRESULT setCookieEnabled([in] BOOL enable);
HRESULT cookieEnabled([out, retval] BOOL* enabled);
}
......@@ -4943,6 +4943,27 @@ HRESULT STDMETHODCALLTYPE WebView::transparent(BOOL* transparent)
return S_OK;
}
HRESULT STDMETHODCALLTYPE WebView::setCookieEnabled(BOOL enable)
{
if (!m_page)
return E_FAIL;
m_page->setCookieEnabled(enable);
return S_OK;
}
HRESULT STDMETHODCALLTYPE WebView::cookieEnabled(BOOL* enabled)
{
if (!enabled)
return E_POINTER;
if (!m_page)
return E_FAIL;
*enabled = m_page->cookieEnabled();
return S_OK;
}
HRESULT STDMETHODCALLTYPE WebView::setDefersCallbacks(BOOL defersCallbacks)
{
if (!m_page)
......
......@@ -696,6 +696,12 @@ public:
virtual HRESULT STDMETHODCALLTYPE alwaysUsesComplexTextCodePath(
/* [out, retval] */ BOOL* complex);
virtual HRESULT STDMETHODCALLTYPE setCookieEnabled(
/* [in] */ BOOL enable);
virtual HRESULT STDMETHODCALLTYPE cookieEnabled(
/* [out, retval] */ BOOL* enabled);
// WebView
WebCore::Page* page();
bool handleMouseEvent(UINT, WPARAM, LPARAM);
......
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