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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2048 void WebContentsImpl::SelectRange(const gfx::Point& base, | 2048 void WebContentsImpl::SelectRange(const gfx::Point& base, |
2049 const gfx::Point& extent) { | 2049 const gfx::Point& extent) { |
2050 RenderFrameHost* focused_frame = GetFocusedFrame(); | 2050 RenderFrameHost* focused_frame = GetFocusedFrame(); |
2051 if (!focused_frame) | 2051 if (!focused_frame) |
2052 return; | 2052 return; |
2053 | 2053 |
2054 focused_frame->Send( | 2054 focused_frame->Send( |
2055 new InputMsg_SelectRange(focused_frame->GetRoutingID(), base, extent)); | 2055 new InputMsg_SelectRange(focused_frame->GetRoutingID(), base, extent)); |
2056 } | 2056 } |
2057 | 2057 |
2058 void WebContentsImpl::ExpandSelectionByCharacterOffset(int start_adjust, | |
2059 int end_adjust) { | |
2060 RenderFrameHost* focused_frame = GetFocusedFrame(); | |
Charlie Reis
2015/07/07 17:02:27
Yes, operating on the focused frame sounds right t
| |
2061 if (!focused_frame) | |
2062 return; | |
2063 | |
2064 focused_frame->Send(new InputMsg_ExpandSelectionByCharacterOffset( | |
2065 focused_frame->GetRoutingID(), start_adjust, end_adjust)); | |
2066 } | |
2067 | |
2058 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { | 2068 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { |
2059 const gfx::Size old_size = GetPreferredSize(); | 2069 const gfx::Size old_size = GetPreferredSize(); |
2060 preferred_size_ = pref_size; | 2070 preferred_size_ = pref_size; |
2061 OnPreferredSizeChanged(old_size); | 2071 OnPreferredSizeChanged(old_size); |
2062 } | 2072 } |
2063 | 2073 |
2064 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) { | 2074 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) { |
2065 if (delegate_) | 2075 if (delegate_) |
2066 delegate_->ResizeDueToAutoResize(this, new_size); | 2076 delegate_->ResizeDueToAutoResize(this, new_size); |
2067 } | 2077 } |
(...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4476 player_map->erase(it); | 4486 player_map->erase(it); |
4477 } | 4487 } |
4478 | 4488 |
4479 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4489 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4480 force_disable_overscroll_content_ = force_disable; | 4490 force_disable_overscroll_content_ = force_disable; |
4481 if (view_) | 4491 if (view_) |
4482 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4492 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4483 } | 4493 } |
4484 | 4494 |
4485 } // namespace content | 4495 } // namespace content |
OLD | NEW |