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 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 void RenderViewHostImpl::OnTakeFocus(bool reverse) { | 1066 void RenderViewHostImpl::OnTakeFocus(bool reverse) { |
1067 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); | 1067 RenderViewHostDelegateView* view = delegate_->GetDelegateView(); |
1068 if (view) | 1068 if (view) |
1069 view->TakeFocus(reverse); | 1069 view->TakeFocus(reverse); |
1070 } | 1070 } |
1071 | 1071 |
1072 void RenderViewHostImpl::OnFocusedNodeChanged( | 1072 void RenderViewHostImpl::OnFocusedNodeChanged( |
1073 bool is_editable_node, | 1073 bool is_editable_node, |
1074 const gfx::Rect& node_bounds_in_viewport) { | 1074 const gfx::Rect& node_bounds_in_viewport) { |
1075 is_focused_element_editable_ = is_editable_node; | 1075 is_focused_element_editable_ = is_editable_node; |
1076 if (GetWidget()->GetView()) | |
1077 GetWidget()->GetView()->FocusedNodeChanged(is_editable_node); | |
1078 | 1076 |
1079 // None of the rest makes sense without a view. | 1077 // None of the rest makes sense without a view. |
1080 if (!GetWidget()->GetView()) | 1078 if (!GetWidget()->GetView()) |
1081 return; | 1079 return; |
1082 | 1080 |
1083 // Convert node_bounds to screen coordinates. | 1081 // Convert node_bounds to screen coordinates. |
1084 gfx::Rect view_bounds_in_screen = GetWidget()->GetView()->GetViewBounds(); | 1082 gfx::Rect view_bounds_in_screen = GetWidget()->GetView()->GetViewBounds(); |
1085 gfx::Point origin = node_bounds_in_viewport.origin(); | 1083 gfx::Point origin = node_bounds_in_viewport.origin(); |
1086 origin.Offset(view_bounds_in_screen.x(), view_bounds_in_screen.y()); | 1084 origin.Offset(view_bounds_in_screen.x(), view_bounds_in_screen.y()); |
1087 gfx::Rect node_bounds_in_screen(origin.x(), origin.y(), | 1085 gfx::Rect node_bounds_in_screen(origin.x(), origin.y(), |
1088 node_bounds_in_viewport.width(), | 1086 node_bounds_in_viewport.width(), |
1089 node_bounds_in_viewport.height()); | 1087 node_bounds_in_viewport.height()); |
| 1088 |
| 1089 GetWidget()->GetView()->FocusedNodeChanged( |
| 1090 is_editable_node, node_bounds_in_screen); |
| 1091 |
1090 FocusedNodeDetails details = {is_editable_node, node_bounds_in_screen}; | 1092 FocusedNodeDetails details = {is_editable_node, node_bounds_in_screen}; |
1091 NotificationService::current()->Notify(NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | 1093 NotificationService::current()->Notify(NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
1092 Source<RenderViewHost>(this), | 1094 Source<RenderViewHost>(this), |
1093 Details<FocusedNodeDetails>(&details)); | 1095 Details<FocusedNodeDetails>(&details)); |
1094 } | 1096 } |
1095 | 1097 |
1096 void RenderViewHostImpl::OnClosePageACK() { | 1098 void RenderViewHostImpl::OnClosePageACK() { |
1097 GetWidget()->decrement_in_flight_event_count(); | 1099 GetWidget()->decrement_in_flight_event_count(); |
1098 ClosePageIgnoringUnloadEvents(); | 1100 ClosePageIgnoringUnloadEvents(); |
1099 } | 1101 } |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 // Note: We are using the origin URL provided by the sender here. It may be | 1323 // Note: We are using the origin URL provided by the sender here. It may be |
1322 // different from the receiver's. | 1324 // different from the receiver's. |
1323 file_system_file.url = | 1325 file_system_file.url = |
1324 GURL(storage::GetIsolatedFileSystemRootURIString( | 1326 GURL(storage::GetIsolatedFileSystemRootURIString( |
1325 file_system_url.origin(), filesystem_id, std::string()) | 1327 file_system_url.origin(), filesystem_id, std::string()) |
1326 .append(register_name)); | 1328 .append(register_name)); |
1327 } | 1329 } |
1328 } | 1330 } |
1329 | 1331 |
1330 } // namespace content | 1332 } // namespace content |
OLD | NEW |