diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 20:09:34 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 20:09:34 +0000 |
commit | e87756663c751faea164d8deddbfccbfbbb1cfca (patch) | |
tree | 269ac3d28f509b63046674aa1c1204288bf2292b /chrome/renderer | |
parent | 120671afa85fa5bcbe689c5078d0eeb6449b3b6d (diff) | |
download | chromium_src-e87756663c751faea164d8deddbfccbfbbb1cfca.zip chromium_src-e87756663c751faea164d8deddbfccbfbbb1cfca.tar.gz chromium_src-e87756663c751faea164d8deddbfccbfbbb1cfca.tar.bz2 |
Reverting the autofill popu CL as it creates perf regression.
TBR=nsylvain
Review URL: http://codereview.chromium.org/9460
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4908 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 36 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 17 | ||||
-rw-r--r-- | chrome/renderer/render_widget.cc | 14 | ||||
-rw-r--r-- | chrome/renderer/render_widget.h | 9 | ||||
-rw-r--r-- | chrome/renderer/render_widget_unittest.cc | 6 |
5 files changed, 14 insertions, 68 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index cbae9d0..7cebc16 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -142,7 +142,7 @@ class RenderViewExtraRequestData : public WebRequest::ExtraData { /////////////////////////////////////////////////////////////////////////////// RenderView::RenderView() - : RenderWidget(RenderThread::current(), true), + : RenderWidget(RenderThread::current()), is_loading_(false), page_id_(-1), last_page_id_sent_to_browser_(-1), @@ -161,8 +161,7 @@ RenderView::RenderView() has_unload_listener_(false), decrement_shared_popup_at_destruction_(false), greasemonkey_enabled_(false), - waiting_for_create_window_ack_(false), - form_field_autofill_request_id_(0) { + waiting_for_create_window_ack_(false) { resource_dispatcher_ = new ResourceDispatcher(this); #ifdef CHROME_PERSONALIZATION personalization_ = Personalization::CreateRendererPersonalization(); @@ -385,8 +384,6 @@ void RenderView::OnMessageReceived(const IPC::Message& message) { OnMessageFromExternalHost) IPC_MESSAGE_HANDLER(ViewMsg_DisassociateFromPopupCount, OnDisassociateFromPopupCount) - IPC_MESSAGE_HANDLER(ViewMsg_AutofillSuggestions, - OnReceivedAutofillSuggestions) // Have the super handle all other messages. IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) IPC_END_MESSAGE_MAP() @@ -1667,29 +1664,6 @@ void RenderView::OnUnloadListenerChanged(WebView* webview, WebFrame* webframe) { } } -void RenderView::QueryFormFieldAutofill(const std::wstring& field_name, - const std::wstring& text, - int64 node_id) { - static int message_id_counter = 0; - form_field_autofill_request_id_ = message_id_counter++; - Send(new ViewHostMsg_QueryFormFieldAutofill(routing_id_, - field_name, text, - node_id, - form_field_autofill_request_id_)); -} - -void RenderView::OnReceivedAutofillSuggestions( - int64 node_id, - int request_id, - const std::vector<std::wstring> suggestions, - int default_suggestion_index) { - if (!webview() || request_id != form_field_autofill_request_id_) - return; - - webview()->AutofillSuggestionsForNode(node_id, suggestions, - default_suggestion_index); -} - void RenderView::ShowModalHTMLDialog(const GURL& url, int width, int height, const std::string& json_arguments, std::string* json_retval) { @@ -1788,11 +1762,9 @@ WebView* RenderView::CreateWebView(WebView* webview, bool user_gesture) { return view->webview(); } -WebWidget* RenderView::CreatePopupWidget(WebView* webview, - bool focus_on_show) { +WebWidget* RenderView::CreatePopupWidget(WebView* webview) { RenderWidget* widget = RenderWidget::Create(routing_id_, - RenderThread::current(), - focus_on_show); + RenderThread::current()); return widget->webwidget(); } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 8484afd..eee08e1 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -127,9 +127,6 @@ class RenderView : public RenderWidget, public WebViewDelegate, virtual bool RunBeforeUnloadConfirm(WebView* webview, const std::wstring& message); virtual void OnUnloadListenerChanged(WebView* webview, WebFrame* webframe); - virtual void QueryFormFieldAutofill(const std::wstring& field_name, - const std::wstring& text, - int64 node_id); virtual void UpdateTargetURL(WebView* webview, const GURL& url); virtual void RunFileChooser(const std::wstring& default_filename, @@ -200,8 +197,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, bool is_redirect); virtual WebView* CreateWebView(WebView* webview, bool user_gesture); - virtual WebWidget* CreatePopupWidget(WebView* webview, - bool focus_on_show); + virtual WebWidget* CreatePopupWidget(WebView* webview); virtual WebPluginDelegate* CreatePluginDelegate( WebView* webview, const GURL& url, @@ -461,13 +457,6 @@ class RenderView : public RenderWidget, public WebViewDelegate, // Notification about ui theme changes. void OnThemeChanged(); - // Notification that we have received autofill suggestion. - void OnReceivedAutofillSuggestions( - int64 node_id, - int request_id, - const std::vector<std::wstring> suggestions, - int default_suggestion_index); - #ifdef CHROME_PERSONALIZATION void OnPersonalizationEvent(std::string event_name, std::string event_args); #endif @@ -684,10 +673,6 @@ class RenderView : public RenderWidget, public WebViewDelegate, // Set if we are waiting for an ack for ViewHostMsg_CreateWindow bool waiting_for_create_window_ack_; - // The id of the last request sent for form field autofill. Used to ignore - // out of date responses. - int form_field_autofill_request_id_; - // A cached WebHistoryItem used for back/forward navigations initiated by // WebCore (via the window.history.go API). We only have one such navigation // pending at a time. diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index ab1a270..3cffb60f 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -69,8 +69,7 @@ DeferredCloses* DeferredCloses::current_ = NULL; /////////////////////////////////////////////////////////////////////////////// -RenderWidget::RenderWidget(RenderThreadBase* render_thread, - bool focus_on_show) +RenderWidget::RenderWidget(RenderThreadBase* render_thread) : routing_id_(MSG_ROUTING_NONE), opener_id_(MSG_ROUTING_NONE), render_thread_(render_thread), @@ -89,8 +88,7 @@ RenderWidget::RenderWidget(RenderThreadBase* render_thread, ime_control_x_(-1), ime_control_y_(-1), ime_control_new_state_(false), - ime_control_updated_(false), - focus_on_show_(focus_on_show) { + ime_control_updated_(false) { RenderProcess::AddRefProcess(); DCHECK(render_thread_); } @@ -109,11 +107,9 @@ RenderWidget::~RenderWidget() { /*static*/ RenderWidget* RenderWidget::Create(int32 opener_id, - RenderThreadBase* render_thread, - bool focus_on_show) { + RenderThreadBase* render_thread) { DCHECK(opener_id != MSG_ROUTING_NONE); - scoped_refptr<RenderWidget> widget = new RenderWidget(render_thread, - focus_on_show); + scoped_refptr<RenderWidget> widget = new RenderWidget(render_thread); widget->Init(opener_id); // adds reference return widget; } @@ -129,7 +125,7 @@ void RenderWidget::Init(int32 opener_id) { webwidget_.swap(&webwidget); bool result = render_thread_->Send( - new ViewHostMsg_CreateWidget(opener_id, focus_on_show_, &routing_id_)); + new ViewHostMsg_CreateWidget(opener_id, &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 f597dff..98d0377 100644 --- a/chrome/renderer/render_widget.h +++ b/chrome/renderer/render_widget.h @@ -30,9 +30,7 @@ class RenderWidget : public IPC::Channel::Listener, // Creates a new RenderWidget. The opener_id is the routing ID of the // RenderView that this widget lives inside. The render_thread is any // RenderThreadBase implementation, mostly commonly RenderThread::current(). - static RenderWidget* Create(int32 opener_id, - RenderThreadBase* render_thread, - bool focus_on_show); + static RenderWidget* Create(int32 opener_id, RenderThreadBase* render_thread); // The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if // not yet assigned a view ID, in which case, the process MUST NOT send @@ -88,7 +86,7 @@ class RenderWidget : public IPC::Channel::Listener, // without ref-counting is an error. friend class base::RefCounted<RenderWidget>; - RenderWidget(RenderThreadBase* render_thread, bool focus_on_show); + RenderWidget(RenderThreadBase* render_thread); virtual ~RenderWidget(); // Initializes this view with the given opener. CompleteInit must be called @@ -263,9 +261,6 @@ class RenderWidget : public IPC::Channel::Listener, bool ime_control_new_state_; bool ime_control_updated_; - // Whether the window for this RenderWidget should be focused when shown. - bool focus_on_show_; - // Holds all the needed plugin window moves for a scroll. std::vector<WebPluginGeometry> plugin_window_moves_; diff --git a/chrome/renderer/render_widget_unittest.cc b/chrome/renderer/render_widget_unittest.cc index f280aa7..086f8bf 100644 --- a/chrome/renderer/render_widget_unittest.cc +++ b/chrome/renderer/render_widget_unittest.cc @@ -114,9 +114,7 @@ class MockRenderThread : public RenderThreadBase { } // The Widget expects to be returned valid route_id. - void OnMsgCreateWidget(int opener_id, - bool focus_on_show, - int* route_id) { + void OnMsgCreateWidget(int opener_id, int* route_id) { opener_id_ = opener_id; *route_id = routing_id_; } @@ -143,7 +141,7 @@ TEST(RenderWidgetTest, CreateAndCloseWidget) { { scoped_refptr<RenderWidget> rw = - RenderWidget::Create(kOpenerId, &render_thread, true); + RenderWidget::Create(kOpenerId, &render_thread); ASSERT_TRUE(rw != NULL); // After the RenderWidget it must have sent a message to the render thread |