| OLD | NEW |
| 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 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 key.utf8(), | 2512 key.utf8(), |
| 2513 value.utf8())); | 2513 value.utf8())); |
| 2514 } | 2514 } |
| 2515 | 2515 |
| 2516 // WebKit::WebWidgetClient ---------------------------------------------------- | 2516 // WebKit::WebWidgetClient ---------------------------------------------------- |
| 2517 | 2517 |
| 2518 void RenderViewImpl::didFocus() { | 2518 void RenderViewImpl::didFocus() { |
| 2519 // TODO(jcivelli): when https://bugs.webkit.org/show_bug.cgi?id=33389 is fixed | 2519 // TODO(jcivelli): when https://bugs.webkit.org/show_bug.cgi?id=33389 is fixed |
| 2520 // we won't have to test for user gesture anymore and we can | 2520 // we won't have to test for user gesture anymore and we can |
| 2521 // move that code back to render_widget.cc | 2521 // move that code back to render_widget.cc |
| 2522 if (webview() && webview()->mainFrame() && | 2522 if (webview() && webview()->mainFrame()) { |
| 2523 webview()->mainFrame()->isProcessingUserGesture()) { | 2523 if (webview()->mainFrame()->isProcessingUserGesture() || |
| 2524 Send(new ViewHostMsg_Focus(routing_id_)); | 2524 !RenderThreadImpl::current()->require_user_gesture_for_focus()) { |
| 2525 Send(new ViewHostMsg_Focus(routing_id_)); |
| 2526 } |
| 2525 } | 2527 } |
| 2526 } | 2528 } |
| 2527 | 2529 |
| 2528 void RenderViewImpl::didBlur() { | 2530 void RenderViewImpl::didBlur() { |
| 2529 // TODO(jcivelli): see TODO above in didFocus(). | 2531 // TODO(jcivelli): see TODO above in didFocus(). |
| 2530 if (webview() && webview()->mainFrame() && | 2532 if (webview() && webview()->mainFrame()) { |
| 2531 webview()->mainFrame()->isProcessingUserGesture()) { | 2533 if (webview()->mainFrame()->isProcessingUserGesture() || |
| 2532 Send(new ViewHostMsg_Blur(routing_id_)); | 2534 !RenderThreadImpl::current()->require_user_gesture_for_focus()) { |
| 2535 Send(new ViewHostMsg_Blur(routing_id_)); |
| 2536 } |
| 2533 } | 2537 } |
| 2534 } | 2538 } |
| 2535 | 2539 |
| 2536 // We are supposed to get a single call to Show for a newly created RenderView | 2540 // We are supposed to get a single call to Show for a newly created RenderView |
| 2537 // that was created via RenderViewImpl::CreateWebView. So, we wait until this | 2541 // that was created via RenderViewImpl::CreateWebView. So, we wait until this |
| 2538 // point to dispatch the ShowView message. | 2542 // point to dispatch the ShowView message. |
| 2539 // | 2543 // |
| 2540 // This method provides us with the information about how to display the newly | 2544 // This method provides us with the information about how to display the newly |
| 2541 // created RenderView (i.e., as a blocked popup or as a new tab). | 2545 // created RenderView (i.e., as a blocked popup or as a new tab). |
| 2542 // | 2546 // |
| (...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6706 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6710 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6707 RenderProcess::current()->ReleaseTransportDIB(dib); | 6711 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6708 } | 6712 } |
| 6709 | 6713 |
| 6710 void RenderViewImpl::DidCommitCompositorFrame() { | 6714 void RenderViewImpl::DidCommitCompositorFrame() { |
| 6711 RenderWidget::DidCommitCompositorFrame(); | 6715 RenderWidget::DidCommitCompositorFrame(); |
| 6712 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); | 6716 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); |
| 6713 } | 6717 } |
| 6714 | 6718 |
| 6715 } // namespace content | 6719 } // namespace content |
| OLD | NEW |