| 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 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2018 | 2018 |
| 2019 // NOTE: initial_rect_ may still have its default values at this point, but | 2019 // NOTE: initial_rect_ may still have its default values at this point, but |
| 2020 // that's okay. It'll be ignored if disposition is not NEW_POPUP, or the | 2020 // that's okay. It'll be ignored if disposition is not NEW_POPUP, or the |
| 2021 // browser process will impose a default position otherwise. | 2021 // browser process will impose a default position otherwise. |
| 2022 Send(new ViewHostMsg_ShowView(opener_id_, routing_id_, | 2022 Send(new ViewHostMsg_ShowView(opener_id_, routing_id_, |
| 2023 NavigationPolicyToDisposition(policy), initial_rect_, | 2023 NavigationPolicyToDisposition(policy), initial_rect_, |
| 2024 opened_by_user_gesture_)); | 2024 opened_by_user_gesture_)); |
| 2025 SetPendingWindowRect(initial_rect_); | 2025 SetPendingWindowRect(initial_rect_); |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 void RenderViewImpl::runModal() { | |
| 2029 DCHECK(did_show_) << "should already have shown the view"; | |
| 2030 | |
| 2031 // Don't allow further dialogs if we are waiting to swap out, since the | |
| 2032 // PageGroupLoadDeferrer in our stack prevents it. | |
| 2033 if (suppress_dialogs_until_swap_out_) | |
| 2034 return; | |
| 2035 | |
| 2036 // We must keep WebKit's shared timer running in this case in order to allow | |
| 2037 // showModalDialog to function properly. | |
| 2038 // | |
| 2039 // TODO(darin): WebKit should really be smarter about suppressing events and | |
| 2040 // timers so that we do not need to manage the shared timer in such a heavy | |
| 2041 // handed manner. | |
| 2042 // | |
| 2043 if (RenderThreadImpl::current()) // Will be NULL during unit tests. | |
| 2044 RenderThreadImpl::current()->DoNotSuspendWebKitSharedTimer(); | |
| 2045 | |
| 2046 SendAndRunNestedMessageLoop(new ViewHostMsg_RunModal( | |
| 2047 routing_id_, opener_id_)); | |
| 2048 } | |
| 2049 | |
| 2050 bool RenderViewImpl::requestPointerLock() { | 2028 bool RenderViewImpl::requestPointerLock() { |
| 2051 return mouse_lock_dispatcher_->LockMouse(webwidget_mouse_lock_target_.get()); | 2029 return mouse_lock_dispatcher_->LockMouse(webwidget_mouse_lock_target_.get()); |
| 2052 } | 2030 } |
| 2053 | 2031 |
| 2054 void RenderViewImpl::requestPointerUnlock() { | 2032 void RenderViewImpl::requestPointerUnlock() { |
| 2055 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); | 2033 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); |
| 2056 } | 2034 } |
| 2057 | 2035 |
| 2058 bool RenderViewImpl::isPointerLocked() { | 2036 bool RenderViewImpl::isPointerLocked() { |
| 2059 return mouse_lock_dispatcher_->IsMouseLockedTo( | 2037 return mouse_lock_dispatcher_->IsMouseLockedTo( |
| (...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4059 std::vector<gfx::Size> sizes; | 4037 std::vector<gfx::Size> sizes; |
| 4060 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4038 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4061 if (!url.isEmpty()) | 4039 if (!url.isEmpty()) |
| 4062 urls.push_back( | 4040 urls.push_back( |
| 4063 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4041 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4064 } | 4042 } |
| 4065 SendUpdateFaviconURL(urls); | 4043 SendUpdateFaviconURL(urls); |
| 4066 } | 4044 } |
| 4067 | 4045 |
| 4068 } // namespace content | 4046 } // namespace content |
| OLD | NEW |