| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2289 GetRenderWidget()->GetWebWidget()->textInputInfo(); | 2289 GetRenderWidget()->GetWebWidget()->textInputInfo(); |
| 2290 FormFieldData field; | 2290 FormFieldData field; |
| 2291 field.text = info.value.utf8(); | 2291 field.text = info.value.utf8(); |
| 2292 field.placeholder = element.getAttribute("placeholder").utf8(); | 2292 field.placeholder = element.getAttribute("placeholder").utf8(); |
| 2293 field.text_input_type = GetRenderWidget()->GetTextInputType(); | 2293 field.text_input_type = GetRenderWidget()->GetTextInputType(); |
| 2294 | 2294 |
| 2295 Send(new FrameHostMsg_FocusedFormFieldDataResponse(routing_id_, request_id, | 2295 Send(new FrameHostMsg_FocusedFormFieldDataResponse(routing_id_, request_id, |
| 2296 field)); | 2296 field)); |
| 2297 } | 2297 } |
| 2298 | 2298 |
| 2299 bool RenderFrameImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) { |
| 2300 if (RenderThreadImpl::current()) |
| 2301 RenderThreadImpl::current()->DoNotNotifyWebKitOfModalLoop(); |
| 2302 message->EnableMessagePumping(); |
| 2303 return Send(message); |
| 2304 } |
| 2305 |
| 2299 bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type, | 2306 bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type, |
| 2300 const base::string16& message, | 2307 const base::string16& message, |
| 2301 const base::string16& default_value, | 2308 const base::string16& default_value, |
| 2302 const GURL& frame_url, | 2309 const GURL& frame_url, |
| 2303 base::string16* result) { | 2310 base::string16* result) { |
| 2304 // Don't allow further dialogs if we are waiting to swap out, since the | 2311 // Don't allow further dialogs if we are waiting to swap out, since the |
| 2305 // ScopedPageLoadDeferrer in our stack prevents it. | 2312 // ScopedPageLoadDeferrer in our stack prevents it. |
| 2306 if (suppress_further_dialogs_) | 2313 if (suppress_further_dialogs_) |
| 2307 return false; | 2314 return false; |
| 2308 | 2315 |
| 2309 int32_t message_length = static_cast<int32_t>(message.length()); | 2316 int32_t message_length = static_cast<int32_t>(message.length()); |
| 2310 if (WebUserGestureIndicator::processedUserGestureSinceLoad(frame_)) { | 2317 if (WebUserGestureIndicator::processedUserGestureSinceLoad(frame_)) { |
| 2311 UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.UserGestureSinceLoad", | 2318 UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.UserGestureSinceLoad", |
| 2312 message_length); | 2319 message_length); |
| 2313 } else { | 2320 } else { |
| 2314 UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.NoUserGestureSinceLoad", | 2321 UMA_HISTOGRAM_COUNTS("JSDialogs.CharacterCount.NoUserGestureSinceLoad", |
| 2315 message_length); | 2322 message_length); |
| 2316 } | 2323 } |
| 2317 | 2324 |
| 2318 bool success = false; | 2325 bool success = false; |
| 2319 base::string16 result_temp; | 2326 base::string16 result_temp; |
| 2320 if (!result) | 2327 if (!result) |
| 2321 result = &result_temp; | 2328 result = &result_temp; |
| 2322 | 2329 |
| 2323 Send(new FrameHostMsg_RunJavaScriptMessage( | 2330 SendAndRunNestedMessageLoop(new FrameHostMsg_RunJavaScriptMessage( |
| 2324 routing_id_, message, default_value, frame_url, type, &success, result)); | 2331 routing_id_, message, default_value, frame_url, type, &success, result)); |
| 2325 return success; | 2332 return success; |
| 2326 } | 2333 } |
| 2327 | 2334 |
| 2328 bool RenderFrameImpl::ScheduleFileChooser( | 2335 bool RenderFrameImpl::ScheduleFileChooser( |
| 2329 const FileChooserParams& params, | 2336 const FileChooserParams& params, |
| 2330 blink::WebFileChooserCompletion* completion) { | 2337 blink::WebFileChooserCompletion* completion) { |
| 2331 static const size_t kMaximumPendingFileChooseRequests = 4; | 2338 static const size_t kMaximumPendingFileChooseRequests = 4; |
| 2332 | 2339 |
| 2333 // Do not open the file dialog in a hidden RenderFrame. | 2340 // Do not open the file dialog in a hidden RenderFrame. |
| (...skipping 4330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6664 // event target. Potentially a Pepper plugin will receive the event. | 6671 // event target. Potentially a Pepper plugin will receive the event. |
| 6665 // In order to tell whether a plugin gets the last mouse event and which it | 6672 // In order to tell whether a plugin gets the last mouse event and which it |
| 6666 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6673 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6667 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6674 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6668 // |pepper_last_mouse_event_target_|. | 6675 // |pepper_last_mouse_event_target_|. |
| 6669 pepper_last_mouse_event_target_ = nullptr; | 6676 pepper_last_mouse_event_target_ = nullptr; |
| 6670 #endif | 6677 #endif |
| 6671 } | 6678 } |
| 6672 | 6679 |
| 6673 } // namespace content | 6680 } // namespace content |
| OLD | NEW |