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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3167 | 3167 |
3168 // TODO(avi): Remove. http://crbug.com/170921 | 3168 // TODO(avi): Remove. http://crbug.com/170921 |
3169 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; | 3169 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; |
3170 NotificationDetails det = NotificationService::NoDetails(); | 3170 NotificationDetails det = NotificationService::NoDetails(); |
3171 if (details) | 3171 if (details) |
3172 det = Details<LoadNotificationDetails>(details); | 3172 det = Details<LoadNotificationDetails>(details); |
3173 NotificationService::current()->Notify( | 3173 NotificationService::current()->Notify( |
3174 type, Source<NavigationController>(&controller_), det); | 3174 type, Source<NavigationController>(&controller_), det); |
3175 } | 3175 } |
3176 | 3176 |
3177 void WebContentsImpl::SelectRange(const gfx::Point& start, | 3177 void WebContentsImpl::MoveRangeSelectionExtent(const gfx::Point& extent) { |
3178 const gfx::Point& end) { | 3178 RenderFrameHost* focused_frame = GetFocusedFrame(); |
| 3179 if (!focused_frame) |
| 3180 return; |
| 3181 |
| 3182 focused_frame->Send(new InputMsg_MoveRangeSelectionExtent( |
| 3183 focused_frame->GetRoutingID(), extent)); |
| 3184 } |
| 3185 |
| 3186 void WebContentsImpl::SelectRange(const gfx::Point& base, |
| 3187 const gfx::Point& extent) { |
3179 RenderFrameHost* focused_frame = GetFocusedFrame(); | 3188 RenderFrameHost* focused_frame = GetFocusedFrame(); |
3180 if (!focused_frame) | 3189 if (!focused_frame) |
3181 return; | 3190 return; |
3182 | 3191 |
3183 focused_frame->Send( | 3192 focused_frame->Send( |
3184 new InputMsg_SelectRange(focused_frame->GetRoutingID(), start, end)); | 3193 new InputMsg_SelectRange(focused_frame->GetRoutingID(), base, extent)); |
3185 } | 3194 } |
3186 | 3195 |
3187 void WebContentsImpl::UpdateMaxPageIDIfNecessary(RenderViewHost* rvh) { | 3196 void WebContentsImpl::UpdateMaxPageIDIfNecessary(RenderViewHost* rvh) { |
3188 // If we are creating a RVH for a restored controller, then we need to make | 3197 // If we are creating a RVH for a restored controller, then we need to make |
3189 // sure the RenderView starts with a next_page_id_ larger than the number | 3198 // sure the RenderView starts with a next_page_id_ larger than the number |
3190 // of restored entries. This must be called before the RenderView starts | 3199 // of restored entries. This must be called before the RenderView starts |
3191 // navigating (to avoid a race between the browser updating max_page_id and | 3200 // navigating (to avoid a race between the browser updating max_page_id and |
3192 // the renderer updating next_page_id_). Because of this, we only call this | 3201 // the renderer updating next_page_id_). Because of this, we only call this |
3193 // from CreateRenderView and allow that to notify the RenderView for us. | 3202 // from CreateRenderView and allow that to notify the RenderView for us. |
3194 int max_restored_page_id = controller_.GetMaxRestoredPageID(); | 3203 int max_restored_page_id = controller_.GetMaxRestoredPageID(); |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4335 node->render_manager()->ResumeResponseDeferredAtStart(); | 4344 node->render_manager()->ResumeResponseDeferredAtStart(); |
4336 } | 4345 } |
4337 | 4346 |
4338 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4347 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4339 force_disable_overscroll_content_ = force_disable; | 4348 force_disable_overscroll_content_ = force_disable; |
4340 if (view_) | 4349 if (view_) |
4341 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4350 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4342 } | 4351 } |
4343 | 4352 |
4344 } // namespace content | 4353 } // namespace content |
OLD | NEW |