1231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*
268513a70bcd92384395513322f1b801e7bf9c729Steve Block * This file is part of the WebKit project.
368513a70bcd92384395513322f1b801e7bf9c729Steve Block *
468513a70bcd92384395513322f1b801e7bf9c729Steve Block * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
5231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *
6231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * This library is free software; you can redistribute it and/or
7231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * modify it under the terms of the GNU Library General Public
8231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * License as published by the Free Software Foundation; either
9231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * version 2 of the License, or (at your option) any later version.
10231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *
11231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * This library is distributed in the hope that it will be useful,
12231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * but WITHOUT ANY WARRANTY; without even the implied warranty of
13231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * Library General Public License for more details.
15231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *
16231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * You should have received a copy of the GNU Library General Public License
17231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * along with this library; see the file COPYING.LIB.  If not, write to
18231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * Boston, MA 02110-1301, USA.
2068513a70bcd92384395513322f1b801e7bf9c729Steve Block *
21231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block */
22231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "config.h"
2368513a70bcd92384395513322f1b801e7bf9c729Steve Block#include "PlatformBridge.h"
24231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
2568513a70bcd92384395513322f1b801e7bf9c729Steve Block#include "Frame.h"
2668513a70bcd92384395513322f1b801e7bf9c729Steve Block#include "PluginView.h"
2768513a70bcd92384395513322f1b801e7bf9c729Steve Block#include "Widget.h"
28231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
29231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blocknamespace WebCore {
30231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
3168513a70bcd92384395513322f1b801e7bf9c729Steve Blockbool PlatformBridge::popupsAllowed(NPP npp)
32231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
3368513a70bcd92384395513322f1b801e7bf9c729Steve Block    if (npp && npp->ndata)
3468513a70bcd92384395513322f1b801e7bf9c729Steve Block        return static_cast<PluginView*>(npp->ndata)->arePopupsAllowed();
35231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
36231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    return false;
37231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
38231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
3968513a70bcd92384395513322f1b801e7bf9c729Steve BlockNPObject* PlatformBridge::pluginScriptableObject(Widget* widget)
40231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block{
4168513a70bcd92384395513322f1b801e7bf9c729Steve Block    if (!widget)
4268513a70bcd92384395513322f1b801e7bf9c729Steve Block        return 0;
43231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
4468513a70bcd92384395513322f1b801e7bf9c729Steve Block    if (!widget->isPluginView())
4568513a70bcd92384395513322f1b801e7bf9c729Steve Block        return 0;
46231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
4768513a70bcd92384395513322f1b801e7bf9c729Steve Block    PluginView* pluginView = static_cast<PluginView*>(widget);
4868513a70bcd92384395513322f1b801e7bf9c729Steve Block    return pluginView->npObject();
49231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
50231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
51231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block}
52