| 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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 focused_widget->SetPageFocus(true); | 793 focused_widget->SetPageFocus(true); |
| 794 } | 794 } |
| 795 | 795 |
| 796 void RenderWidgetHostImpl::Blur() { | 796 void RenderWidgetHostImpl::Blur() { |
| 797 RenderWidgetHostImpl* focused_widget = | 797 RenderWidgetHostImpl* focused_widget = |
| 798 delegate_ ? delegate_->GetRenderWidgetHostWithPageFocus() : nullptr; | 798 delegate_ ? delegate_->GetRenderWidgetHostWithPageFocus() : nullptr; |
| 799 | 799 |
| 800 if (!focused_widget) | 800 if (!focused_widget) |
| 801 focused_widget = this; | 801 focused_widget = this; |
| 802 focused_widget->SetPageFocus(false); | 802 focused_widget->SetPageFocus(false); |
| 803 if (owner_delegate_) |
| 804 owner_delegate_->RenderWidgetLostFocus(); |
| 805 if (delegate_) |
| 806 delegate_->RenderWidgetLostFocus(this); |
| 803 } | 807 } |
| 804 | 808 |
| 805 void RenderWidgetHostImpl::SetPageFocus(bool focused) { | 809 void RenderWidgetHostImpl::SetPageFocus(bool focused) { |
| 806 is_focused_ = focused; | 810 is_focused_ = focused; |
| 807 | 811 |
| 808 if (!focused) { | 812 if (!focused) { |
| 809 // If there is a pending mouse lock request, we don't want to reject it at | 813 // If there is a pending mouse lock request, we don't want to reject it at |
| 810 // this point. The user can switch focus back to this view and approve the | 814 // this point. The user can switch focus back to this view and approve the |
| 811 // request later. | 815 // request later. |
| 812 if (IsMouseLocked()) | 816 if (IsMouseLocked()) |
| (...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2645 RenderProcessHost* rph = GetProcess(); | 2649 RenderProcessHost* rph = GetProcess(); |
| 2646 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); | 2650 for (std::vector<IPC::Message>::const_iterator i = messages.begin(); |
| 2647 i != messages.end(); ++i) { | 2651 i != messages.end(); ++i) { |
| 2648 rph->OnMessageReceived(*i); | 2652 rph->OnMessageReceived(*i); |
| 2649 if (i->dispatch_error()) | 2653 if (i->dispatch_error()) |
| 2650 rph->OnBadMessageReceived(*i); | 2654 rph->OnBadMessageReceived(*i); |
| 2651 } | 2655 } |
| 2652 } | 2656 } |
| 2653 | 2657 |
| 2654 } // namespace content | 2658 } // namespace content |
| OLD | NEW |