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_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 if (!is_editable_node && virtual_keyboard_requested_) { | 1199 if (!is_editable_node && virtual_keyboard_requested_) { |
1200 virtual_keyboard_requested_ = false; | 1200 virtual_keyboard_requested_ = false; |
1201 delegate_->SetIsVirtualKeyboardRequested(false); | 1201 delegate_->SetIsVirtualKeyboardRequested(false); |
1202 BrowserThread::PostDelayedTask( | 1202 BrowserThread::PostDelayedTask( |
1203 BrowserThread::UI, FROM_HERE, | 1203 BrowserThread::UI, FROM_HERE, |
1204 base::Bind(base::IgnoreResult(&DismissVirtualKeyboardTask)), | 1204 base::Bind(base::IgnoreResult(&DismissVirtualKeyboardTask)), |
1205 TimeDelta::FromMilliseconds(kVirtualKeyboardDisplayWaitTimeoutMs)); | 1205 TimeDelta::FromMilliseconds(kVirtualKeyboardDisplayWaitTimeoutMs)); |
1206 } | 1206 } |
1207 #endif | 1207 #endif |
1208 | 1208 |
| 1209 // None of the rest makes sense without a view. |
| 1210 if (!GetWidget()->GetView()) |
| 1211 return; |
| 1212 |
1209 // Convert node_bounds to screen coordinates. | 1213 // Convert node_bounds to screen coordinates. |
1210 gfx::Rect view_bounds_in_screen = GetWidget()->GetView()->GetViewBounds(); | 1214 gfx::Rect view_bounds_in_screen = GetWidget()->GetView()->GetViewBounds(); |
1211 gfx::Point origin = node_bounds_in_viewport.origin(); | 1215 gfx::Point origin = node_bounds_in_viewport.origin(); |
1212 origin.Offset(view_bounds_in_screen.x(), view_bounds_in_screen.y()); | 1216 origin.Offset(view_bounds_in_screen.x(), view_bounds_in_screen.y()); |
1213 gfx::Rect node_bounds_in_screen(origin.x(), origin.y(), | 1217 gfx::Rect node_bounds_in_screen(origin.x(), origin.y(), |
1214 node_bounds_in_viewport.width(), | 1218 node_bounds_in_viewport.width(), |
1215 node_bounds_in_viewport.height()); | 1219 node_bounds_in_viewport.height()); |
1216 FocusedNodeDetails details = {is_editable_node, node_bounds_in_screen}; | 1220 FocusedNodeDetails details = {is_editable_node, node_bounds_in_screen}; |
1217 NotificationService::current()->Notify(NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | 1221 NotificationService::current()->Notify(NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
1218 Source<RenderViewHost>(this), | 1222 Source<RenderViewHost>(this), |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 } else { | 1417 } else { |
1414 render_view_ready_on_process_launch_ = true; | 1418 render_view_ready_on_process_launch_ = true; |
1415 } | 1419 } |
1416 } | 1420 } |
1417 | 1421 |
1418 void RenderViewHostImpl::RenderViewReady() { | 1422 void RenderViewHostImpl::RenderViewReady() { |
1419 delegate_->RenderViewReady(this); | 1423 delegate_->RenderViewReady(this); |
1420 } | 1424 } |
1421 | 1425 |
1422 } // namespace content | 1426 } // namespace content |
OLD | NEW |