1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #include "public/platform/WebContentSettingCallbacks.h"
9 #include "platform/ContentSettingCallbacks.h"
13 class WebContentSettingCallbacksPrivate
: public RefCounted
<WebContentSettingCallbacksPrivate
> {
15 static PassRefPtr
<WebContentSettingCallbacksPrivate
> create(const PassOwnPtr
<ContentSettingCallbacks
>& callbacks
)
17 return adoptRef(new WebContentSettingCallbacksPrivate(callbacks
));
20 ContentSettingCallbacks
* callbacks() { return m_callbacks
.get(); }
23 WebContentSettingCallbacksPrivate(const PassOwnPtr
<ContentSettingCallbacks
>& callbacks
) : m_callbacks(callbacks
) { }
24 OwnPtr
<ContentSettingCallbacks
> m_callbacks
;
27 WebContentSettingCallbacks::WebContentSettingCallbacks(const PassOwnPtr
<ContentSettingCallbacks
>& callbacks
)
29 m_private
= WebContentSettingCallbacksPrivate::create(callbacks
);
32 void WebContentSettingCallbacks::reset()
37 void WebContentSettingCallbacks::assign(const WebContentSettingCallbacks
& other
)
39 m_private
= other
.m_private
;
42 void WebContentSettingCallbacks::doAllow()
44 ASSERT(!m_private
.isNull());
45 m_private
->callbacks()->onAllowed();
49 void WebContentSettingCallbacks::doDeny()
51 ASSERT(!m_private
.isNull());
52 m_private
->callbacks()->onDenied();