Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / platform / exported / WebContentSettingCallbacks.cpp
blobdb051d082317d1cd7b8ee4d013a79f4326cb2689
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.
5 #include "config.h"
7 #include "public/platform/WebContentSettingCallbacks.h"
9 #include "platform/ContentSettingCallbacks.h"
11 namespace blink {
13 class WebContentSettingCallbacksPrivate : public RefCounted<WebContentSettingCallbacksPrivate> {
14 public:
15 static PassRefPtr<WebContentSettingCallbacksPrivate> create(const PassOwnPtr<ContentSettingCallbacks>& callbacks)
17 return adoptRef(new WebContentSettingCallbacksPrivate(callbacks));
20 ContentSettingCallbacks* callbacks() { return m_callbacks.get(); }
22 private:
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()
34 m_private.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();
46 m_private.reset();
49 void WebContentSettingCallbacks::doDeny()
51 ASSERT(!m_private.isNull());
52 m_private->callbacks()->onDenied();
53 m_private.reset();
56 } // namespace blink