Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 2370393002: Extracting placeholder information from Webkit to Blimp (Closed)
Patch Set: Bypassing the typical text entry path Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "content/common/render_message_filter.mojom.h" 56 #include "content/common/render_message_filter.mojom.h"
57 #include "content/common/site_isolation_policy.h" 57 #include "content/common/site_isolation_policy.h"
58 #include "content/common/view_messages.h" 58 #include "content/common/view_messages.h"
59 #include "content/public/common/bindings_policy.h" 59 #include "content/public/common/bindings_policy.h"
60 #include "content/public/common/browser_side_navigation_policy.h" 60 #include "content/public/common/browser_side_navigation_policy.h"
61 #include "content/public/common/content_client.h" 61 #include "content/public/common/content_client.h"
62 #include "content/public/common/content_constants.h" 62 #include "content/public/common/content_constants.h"
63 #include "content/public/common/content_switches.h" 63 #include "content/public/common/content_switches.h"
64 #include "content/public/common/drop_data.h" 64 #include "content/public/common/drop_data.h"
65 #include "content/public/common/favicon_url.h" 65 #include "content/public/common/favicon_url.h"
66 #include "content/public/common/form_field_data.h"
66 #include "content/public/common/page_importance_signals.h" 67 #include "content/public/common/page_importance_signals.h"
67 #include "content/public/common/page_state.h" 68 #include "content/public/common/page_state.h"
68 #include "content/public/common/page_zoom.h" 69 #include "content/public/common/page_zoom.h"
69 #include "content/public/common/three_d_api_types.h" 70 #include "content/public/common/three_d_api_types.h"
70 #include "content/public/common/url_constants.h" 71 #include "content/public/common/url_constants.h"
71 #include "content/public/common/web_preferences.h" 72 #include "content/public/common/web_preferences.h"
72 #include "content/public/renderer/content_renderer_client.h" 73 #include "content/public/renderer/content_renderer_client.h"
73 #include "content/public/renderer/document_state.h" 74 #include "content/public/renderer/document_state.h"
74 #include "content/public/renderer/navigation_state.h" 75 #include "content/public/renderer/navigation_state.h"
75 #include "content/public/renderer/render_view_observer.h" 76 #include "content/public/renderer/render_view_observer.h"
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 OnDisableScrollbarsForSmallWindows) 1344 OnDisableScrollbarsForSmallWindows)
1344 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) 1345 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs)
1345 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) 1346 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt)
1346 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) 1347 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt)
1347 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) 1348 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive)
1348 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu) 1349 IPC_MESSAGE_HANDLER(ViewMsg_ShowContextMenu, OnShowContextMenu)
1349 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, 1350 IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap,
1350 OnReleaseDisambiguationPopupBitmap) 1351 OnReleaseDisambiguationPopupBitmap)
1351 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) 1352 IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw)
1352 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret) 1353 IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret)
1354 IPC_MESSAGE_HANDLER(ViewMsg_GetFocusedFormFieldData,
1355 OnFocusedFormFieldDataRequested)
1353 1356
1354 // Page messages. 1357 // Page messages.
1355 IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect, 1358 IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect,
1356 OnUpdateWindowScreenRect) 1359 OnUpdateWindowScreenRect)
1357 IPC_MESSAGE_HANDLER(PageMsg_SetZoomLevel, OnSetZoomLevel) 1360 IPC_MESSAGE_HANDLER(PageMsg_SetZoomLevel, OnSetZoomLevel)
1358 IPC_MESSAGE_HANDLER(PageMsg_SetDeviceScaleFactor, OnSetDeviceScaleFactor); 1361 IPC_MESSAGE_HANDLER(PageMsg_SetDeviceScaleFactor, OnSetDeviceScaleFactor);
1359 IPC_MESSAGE_HANDLER(PageMsg_WasHidden, OnPageWasHidden) 1362 IPC_MESSAGE_HANDLER(PageMsg_WasHidden, OnPageWasHidden)
1360 IPC_MESSAGE_HANDLER(PageMsg_WasShown, OnPageWasShown) 1363 IPC_MESSAGE_HANDLER(PageMsg_WasShown, OnPageWasShown)
1361 IPC_MESSAGE_HANDLER(PageMsg_SetHistoryOffsetAndLength, 1364 IPC_MESSAGE_HANDLER(PageMsg_SetHistoryOffsetAndLength,
1362 OnSetHistoryOffsetAndLength) 1365 OnSetHistoryOffsetAndLength)
(...skipping 19 matching lines...) Expand all
1382 1385
1383 void RenderViewImpl::OnSelectWordAroundCaret() { 1386 void RenderViewImpl::OnSelectWordAroundCaret() {
1384 if (!webview()) 1387 if (!webview())
1385 return; 1388 return;
1386 1389
1387 input_handler_->set_handling_input_event(true); 1390 input_handler_->set_handling_input_event(true);
1388 webview()->focusedFrame()->selectWordAroundCaret(); 1391 webview()->focusedFrame()->selectWordAroundCaret();
1389 input_handler_->set_handling_input_event(false); 1392 input_handler_->set_handling_input_event(false);
1390 } 1393 }
1391 1394
1395 void RenderViewImpl::OnFocusedFormFieldDataRequested(int request_id) {
1396 blink::WebFrame* web_frame = webview()->focusedFrame();
David Trainor- moved to gerrit 2016/11/03 04:25:49 Should we check if webview() is null or webview()-
1397 WebElement element = web_frame->document().focusedElement();
David Trainor- moved to gerrit 2016/11/03 04:25:49 Check if document().isNull()? Check if focusedEle
1398
1399 blink::WebTextInputInfo info = GetWebWidget()->textInputInfo();
David Trainor- moved to gerrit 2016/11/03 04:25:50 Check if GetWebWidget() is null?
1400 FormFieldData field;
1401 field.text = info.value.utf8();
David Trainor- moved to gerrit 2016/11/03 04:25:50 Are all of these guaranteed to be valid? info.val
1402 field.placeholder = element.getAttribute("placeholder").utf8();
1403 field.text_input_type = GetTextInputType();
1404
1405 Send(
1406 new ViewHostMsg_SetFocusedFormFieldData(routing_id(), request_id, field));
1407 }
1408
1392 void RenderViewImpl::OnUpdateTargetURLAck() { 1409 void RenderViewImpl::OnUpdateTargetURLAck() {
1393 // Check if there is a targeturl waiting to be sent. 1410 // Check if there is a targeturl waiting to be sent.
1394 if (target_url_status_ == TARGET_PENDING) 1411 if (target_url_status_ == TARGET_PENDING)
1395 Send(new ViewHostMsg_UpdateTargetURL(GetRoutingID(), pending_target_url_)); 1412 Send(new ViewHostMsg_UpdateTargetURL(GetRoutingID(), pending_target_url_));
1396 1413
1397 target_url_status_ = TARGET_NONE; 1414 target_url_status_ = TARGET_NONE;
1398 } 1415 }
1399 1416
1400 void RenderViewImpl::OnExecuteEditCommand(const std::string& name, 1417 void RenderViewImpl::OnExecuteEditCommand(const std::string& name,
1401 const std::string& value) { 1418 const std::string& value) {
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
3031 if (IsUseZoomForDSFEnabled()) { 3048 if (IsUseZoomForDSFEnabled()) {
3032 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3049 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3033 } else { 3050 } else {
3034 webview()->setDeviceScaleFactor(device_scale_factor_); 3051 webview()->setDeviceScaleFactor(device_scale_factor_);
3035 } 3052 }
3036 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3053 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3037 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3054 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3038 } 3055 }
3039 3056
3040 } // namespace content 3057 } // namespace content
OLDNEW
« content/public/common/form_field_data.h ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698