| 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 3193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3204 | 3204 |
| 3205 // TODO(avi): Remove. http://crbug.com/170921 | 3205 // TODO(avi): Remove. http://crbug.com/170921 |
| 3206 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; | 3206 int type = is_loading ? NOTIFICATION_LOAD_START : NOTIFICATION_LOAD_STOP; |
| 3207 NotificationDetails det = NotificationService::NoDetails(); | 3207 NotificationDetails det = NotificationService::NoDetails(); |
| 3208 if (details) | 3208 if (details) |
| 3209 det = Details<LoadNotificationDetails>(details); | 3209 det = Details<LoadNotificationDetails>(details); |
| 3210 NotificationService::current()->Notify( | 3210 NotificationService::current()->Notify( |
| 3211 type, Source<NavigationController>(&controller_), det); | 3211 type, Source<NavigationController>(&controller_), det); |
| 3212 } | 3212 } |
| 3213 | 3213 |
| 3214 void WebContentsImpl::SelectRange(const gfx::Point& start, | 3214 void WebContentsImpl::MoveRangeSelectionExtent(const gfx::Point& extent) { |
| 3215 const gfx::Point& end) { | 3215 RenderFrameHost* focused_frame = GetFocusedFrame(); |
| 3216 if (!focused_frame) |
| 3217 return; |
| 3218 |
| 3219 focused_frame->Send(new InputMsg_MoveRangeSelectionExtent( |
| 3220 focused_frame->GetRoutingID(), extent)); |
| 3221 } |
| 3222 |
| 3223 void WebContentsImpl::SelectRange(const gfx::Point& base, |
| 3224 const gfx::Point& extent) { |
| 3216 RenderFrameHost* focused_frame = GetFocusedFrame(); | 3225 RenderFrameHost* focused_frame = GetFocusedFrame(); |
| 3217 if (!focused_frame) | 3226 if (!focused_frame) |
| 3218 return; | 3227 return; |
| 3219 | 3228 |
| 3220 focused_frame->Send( | 3229 focused_frame->Send( |
| 3221 new InputMsg_SelectRange(focused_frame->GetRoutingID(), start, end)); | 3230 new InputMsg_SelectRange(focused_frame->GetRoutingID(), base, extent)); |
| 3222 } | 3231 } |
| 3223 | 3232 |
| 3224 void WebContentsImpl::UpdateMaxPageIDIfNecessary(RenderViewHost* rvh) { | 3233 void WebContentsImpl::UpdateMaxPageIDIfNecessary(RenderViewHost* rvh) { |
| 3225 // If we are creating a RVH for a restored controller, then we need to make | 3234 // If we are creating a RVH for a restored controller, then we need to make |
| 3226 // sure the RenderView starts with a next_page_id_ larger than the number | 3235 // sure the RenderView starts with a next_page_id_ larger than the number |
| 3227 // of restored entries. This must be called before the RenderView starts | 3236 // of restored entries. This must be called before the RenderView starts |
| 3228 // navigating (to avoid a race between the browser updating max_page_id and | 3237 // navigating (to avoid a race between the browser updating max_page_id and |
| 3229 // the renderer updating next_page_id_). Because of this, we only call this | 3238 // the renderer updating next_page_id_). Because of this, we only call this |
| 3230 // from CreateRenderView and allow that to notify the RenderView for us. | 3239 // from CreateRenderView and allow that to notify the RenderView for us. |
| 3231 int max_restored_page_id = controller_.GetMaxRestoredPageID(); | 3240 int max_restored_page_id = controller_.GetMaxRestoredPageID(); |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4371 node->render_manager()->ResumeResponseDeferredAtStart(); | 4380 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4372 } | 4381 } |
| 4373 | 4382 |
| 4374 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4383 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4375 force_disable_overscroll_content_ = force_disable; | 4384 force_disable_overscroll_content_ = force_disable; |
| 4376 if (view_) | 4385 if (view_) |
| 4377 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4386 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4378 } | 4387 } |
| 4379 | 4388 |
| 4380 } // namespace content | 4389 } // namespace content |
| OLD | NEW |