| 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 // send the message in this case, as the main frame's RenderFrameHost and | 1816 // send the message in this case, as the main frame's RenderFrameHost and |
| 1817 // other state has already been cleared. | 1817 // other state has already been cleared. |
| 1818 if (is_being_destroyed_) | 1818 if (is_being_destroyed_) |
| 1819 return; | 1819 return; |
| 1820 | 1820 |
| 1821 frame_tree_.ReplicatePageFocus(is_focused); | 1821 frame_tree_.ReplicatePageFocus(is_focused); |
| 1822 } | 1822 } |
| 1823 | 1823 |
| 1824 RenderWidgetHostImpl* WebContentsImpl::GetFocusedRenderWidgetHost( | 1824 RenderWidgetHostImpl* WebContentsImpl::GetFocusedRenderWidgetHost( |
| 1825 RenderWidgetHostImpl* receiving_widget) { | 1825 RenderWidgetHostImpl* receiving_widget) { |
| 1826 if (!receiving_widget) |
| 1827 receiving_widget = GetMainFrame()->GetRenderWidgetHost(); |
| 1828 |
| 1829 if (!receiving_widget) |
| 1830 return nullptr; |
| 1831 |
| 1826 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) | 1832 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
| 1827 return receiving_widget; | 1833 return receiving_widget; |
| 1828 | 1834 |
| 1829 // Events for widgets other than the main frame (e.g., popup menus) should be | 1835 // Events for widgets other than the main frame (e.g., popup menus) should be |
| 1830 // forwarded directly to the widget they arrived on. | 1836 // forwarded directly to the widget they arrived on. |
| 1831 if (receiving_widget != GetMainFrame()->GetRenderWidgetHost()) | 1837 if (receiving_widget != GetMainFrame()->GetRenderWidgetHost()) |
| 1832 return receiving_widget; | 1838 return receiving_widget; |
| 1833 | 1839 |
| 1834 FrameTreeNode* focused_frame = | 1840 FrameTreeNode* focused_frame = |
| 1835 GetFocusedWebContents()->frame_tree_.GetFocusedFrame(); | 1841 GetFocusedWebContents()->frame_tree_.GetFocusedFrame(); |
| (...skipping 3396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5232 for (RenderViewHost* render_view_host : render_view_host_set) | 5238 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5233 render_view_host->OnWebkitPreferencesChanged(); | 5239 render_view_host->OnWebkitPreferencesChanged(); |
| 5234 } | 5240 } |
| 5235 | 5241 |
| 5236 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5242 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 5237 JavaScriptDialogManager* dialog_manager) { | 5243 JavaScriptDialogManager* dialog_manager) { |
| 5238 dialog_manager_ = dialog_manager; | 5244 dialog_manager_ = dialog_manager; |
| 5239 } | 5245 } |
| 5240 | 5246 |
| 5241 } // namespace content | 5247 } // namespace content |
| OLD | NEW |