summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/mock_render_thread.cc2
-rw-r--r--chrome/renderer/mock_render_thread.h3
-rw-r--r--chrome/renderer/render_view.cc8
-rw-r--r--chrome/renderer/render_view.h2
-rw-r--r--chrome/renderer/render_widget.cc11
-rw-r--r--chrome/renderer/render_widget.h10
-rw-r--r--chrome/renderer/render_widget_unittest.cc4
7 files changed, 23 insertions, 17 deletions
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index cda4fef..49d59c7 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -107,7 +107,7 @@ void MockRenderThread::OnMessageReceived(const IPC::Message& msg) {
// The Widget expects to be returned valid route_id.
void MockRenderThread::OnMsgCreateWidget(int opener_id,
- bool activatable,
+ WebKit::WebPopupType popup_type,
int* route_id) {
opener_id_ = opener_id;
*route_id = routing_id_;
diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h
index 03fe08f..635174b 100644
--- a/chrome/renderer/mock_render_thread.h
+++ b/chrome/renderer/mock_render_thread.h
@@ -11,6 +11,7 @@
#include "chrome/common/ipc_test_sink.h"
#include "chrome/renderer/mock_printer.h"
#include "chrome/renderer/render_thread.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h"
struct ViewMsg_Print_Params;
struct ViewMsg_PrintPages_Params;
@@ -78,7 +79,7 @@ class MockRenderThread : public RenderThreadBase {
// The Widget expects to be returned valid route_id.
void OnMsgCreateWidget(int opener_id,
- bool activatable,
+ WebKit::WebPopupType popup_type,
int* route_id);
// The callee expects to be returned a valid channel_id.
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 1a1e882..5545780 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -310,7 +310,7 @@ struct RenderView::PendingFileChooser {
RenderView::RenderView(RenderThreadBase* render_thread,
const WebPreferences& webkit_preferences,
int64 session_storage_namespace_id)
- : RenderWidget(render_thread, true),
+ : RenderWidget(render_thread, WebKit::WebPopupTypeNone),
enabled_bindings_(0),
target_url_status_(TARGET_NONE),
is_loading_(false),
@@ -1556,17 +1556,17 @@ WebView* RenderView::createView(WebFrame* creator) {
return view->webview();
}
-WebWidget* RenderView::createPopupMenu(bool activatable) {
+WebWidget* RenderView::createPopupMenu(WebKit::WebPopupType popup_type) {
RenderWidget* widget = RenderWidget::Create(routing_id_,
render_thread_,
- activatable);
+ popup_type);
return widget->webwidget();
}
WebWidget* RenderView::createPopupMenu(const WebPopupMenuInfo& info) {
RenderWidget* widget = RenderWidget::Create(routing_id_,
render_thread_,
- true);
+ WebKit::WebPopupTypeSelect);
widget->ConfigureAsExternalPopupMenu(info);
return widget->webwidget();
}
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index cd42daf..97cc7ea 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -201,7 +201,7 @@ class RenderView : public RenderWidget,
// WebKit::WebViewClient
virtual WebKit::WebView* createView(WebKit::WebFrame* creator);
- virtual WebKit::WebWidget* createPopupMenu(bool activatable);
+ virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType popup_type);
virtual WebKit::WebWidget* createPopupMenu(
const WebKit::WebPopupMenuInfo& info);
virtual WebKit::WebStorageNamespace* createSessionStorageNamespace();
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 50af08f..77ec85f 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -45,7 +45,8 @@ using WebKit::WebScreenInfo;
using WebKit::WebSize;
using WebKit::WebTextDirection;
-RenderWidget::RenderWidget(RenderThreadBase* render_thread, bool activatable)
+RenderWidget::RenderWidget(RenderThreadBase* render_thread,
+ WebKit::WebPopupType popup_type)
: routing_id_(MSG_ROUTING_NONE),
webwidget_(NULL),
opener_id_(MSG_ROUTING_NONE),
@@ -67,7 +68,7 @@ RenderWidget::RenderWidget(RenderThreadBase* render_thread, bool activatable)
ime_control_new_state_(false),
ime_control_updated_(false),
ime_control_busy_(false),
- activatable_(activatable),
+ popup_type_(popup_type),
pending_window_rect_count_(0),
suppress_next_char_events_(false) {
RenderProcess::current()->AddRefProcess();
@@ -86,10 +87,10 @@ RenderWidget::~RenderWidget() {
/*static*/
RenderWidget* RenderWidget::Create(int32 opener_id,
RenderThreadBase* render_thread,
- bool activatable) {
+ WebKit::WebPopupType popup_type) {
DCHECK(opener_id != MSG_ROUTING_NONE);
scoped_refptr<RenderWidget> widget = new RenderWidget(render_thread,
- activatable);
+ popup_type);
widget->Init(opener_id); // adds reference
return widget;
}
@@ -112,7 +113,7 @@ void RenderWidget::Init(int32 opener_id) {
webwidget_ = WebPopupMenu::create(this);
bool result = render_thread_->Send(
- new ViewHostMsg_CreateWidget(opener_id, activatable_, &routing_id_));
+ new ViewHostMsg_CreateWidget(opener_id, popup_type_, &routing_id_));
if (result) {
render_thread_->AddRoute(routing_id_, this);
// Take a reference on behalf of the RenderThread. This will be balanced
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index 4781790..2fdc1e5 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -20,6 +20,7 @@
#include "skia/ext/platform_canvas.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCompositionCommand.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h"
#include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
#include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
#include "third_party/WebKit/WebKit/chromium/public/WebWidgetClient.h"
@@ -48,7 +49,7 @@ class RenderWidget : public IPC::Channel::Listener,
// RenderThreadBase implementation, mostly commonly RenderThread::current().
static RenderWidget* Create(int32 opener_id,
RenderThreadBase* render_thread,
- bool activatable);
+ WebKit::WebPopupType popup_type);
// Called after Create to configure a RenderWidget to be rendered by the host
// as a popup menu with the given data.
@@ -110,7 +111,8 @@ class RenderWidget : public IPC::Channel::Listener,
// without ref-counting is an error.
friend class base::RefCounted<RenderWidget>;
- RenderWidget(RenderThreadBase* render_thread, bool activatable);
+ RenderWidget(RenderThreadBase* render_thread,
+ WebKit::WebPopupType popup_type);
virtual ~RenderWidget();
// Initializes this view with the given opener. CompleteInit must be called
@@ -298,8 +300,8 @@ class RenderWidget : public IPC::Channel::Listener,
bool ime_control_updated_;
bool ime_control_busy_;
- // Whether the window for this RenderWidget can be activated.
- bool activatable_;
+ // The kind of popup this widget represents, NONE if not a popup.
+ WebKit::WebPopupType popup_type_;
// Holds all the needed plugin window moves for a scroll.
typedef std::vector<webkit_glue::WebPluginGeometry> WebPluginGeometryVector;
diff --git a/chrome/renderer/render_widget_unittest.cc b/chrome/renderer/render_widget_unittest.cc
index 5808bc0..e1b5ac0 100644
--- a/chrome/renderer/render_widget_unittest.cc
+++ b/chrome/renderer/render_widget_unittest.cc
@@ -9,6 +9,7 @@
#include "chrome/renderer/mock_render_thread.h"
#include "chrome/renderer/render_widget.h"
#include "chrome/renderer/render_thread.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h"
namespace {
@@ -30,7 +31,8 @@ class RenderWidgetTest : public testing::Test {
virtual void SetUp() {
mock_process_.reset(new MockRenderProcess);
render_thread_.set_routing_id(kRouteId);
- widget_ = RenderWidget::Create(kOpenerId, &render_thread_, true);
+ widget_ = RenderWidget::Create(kOpenerId, &render_thread_,
+ WebKit::WebPopupTypeNone);
ASSERT_TRUE(widget_);
}
virtual void TearDown() {