This source file includes following definitions.
- language
- productSub
- vendor
- vendorSub
- userAgent
- plugins
- mimeTypes
- cookieEnabled
- javaEnabled
- getStorageUpdates
- trace
#include "config.h"
#include "core/frame/Navigator.h"
#include "bindings/v8/ScriptController.h"
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/NavigatorID.h"
#include "core/frame/Settings.h"
#include "core/loader/CookieJar.h"
#include "core/loader/FrameLoader.h"
#include "core/plugins/DOMMimeTypeArray.h"
#include "core/plugins/DOMPluginArray.h"
#include "platform/Language.h"
#ifndef WEBCORE_NAVIGATOR_PRODUCT_SUB
#define WEBCORE_NAVIGATOR_PRODUCT_SUB "20030107"
#endif
#ifndef WEBCORE_NAVIGATOR_VENDOR
#define WEBCORE_NAVIGATOR_VENDOR "Google Inc."
#endif
#ifndef WEBCORE_NAVIGATOR_VENDOR_SUB
#define WEBCORE_NAVIGATOR_VENDOR_SUB ""
#endif
namespace WebCore {
Navigator::Navigator(LocalFrame* frame)
: DOMWindowProperty(frame)
{
ScriptWrappable::init(this);
}
Navigator::~Navigator()
{
}
AtomicString Navigator::language() const
{
return defaultLanguage();
}
String Navigator::productSub() const
{
return WEBCORE_NAVIGATOR_PRODUCT_SUB;
}
String Navigator::vendor() const
{
return WEBCORE_NAVIGATOR_VENDOR;
}
String Navigator::vendorSub() const
{
return WEBCORE_NAVIGATOR_VENDOR_SUB;
}
String Navigator::userAgent() const
{
if (!m_frame || !m_frame->page())
return String();
return m_frame->loader().userAgent(m_frame->document()->url());
}
DOMPluginArray* Navigator::plugins() const
{
if (!m_plugins)
m_plugins = DOMPluginArray::create(m_frame);
return m_plugins.get();
}
DOMMimeTypeArray* Navigator::mimeTypes() const
{
if (!m_mimeTypes)
m_mimeTypes = DOMMimeTypeArray::create(m_frame);
return m_mimeTypes.get();
}
bool Navigator::cookieEnabled() const
{
if (!m_frame)
return false;
Settings* settings = m_frame->settings();
if (!settings || !settings->cookieEnabled())
return false;
return cookiesEnabled(m_frame->document());
}
bool Navigator::javaEnabled() const
{
if (!m_frame || !m_frame->settings())
return false;
if (!m_frame->settings()->javaEnabled())
return false;
return true;
}
void Navigator::getStorageUpdates()
{
}
void Navigator::trace(Visitor* visitor)
{
visitor->trace(m_plugins);
visitor->trace(m_mimeTypes);
#if ENABLE(OILPAN)
HeapSupplementable<Navigator>::trace(visitor);
#endif
}
}