Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1205033005: Adds selection expansion support for Contextual Search. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: palmer's comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 void WebContentsImpl::SelectRange(const gfx::Point& base, 2053 void WebContentsImpl::SelectRange(const gfx::Point& base,
2054 const gfx::Point& extent) { 2054 const gfx::Point& extent) {
2055 RenderFrameHost* focused_frame = GetFocusedFrame(); 2055 RenderFrameHost* focused_frame = GetFocusedFrame();
2056 if (!focused_frame) 2056 if (!focused_frame)
2057 return; 2057 return;
2058 2058
2059 focused_frame->Send( 2059 focused_frame->Send(
2060 new InputMsg_SelectRange(focused_frame->GetRoutingID(), base, extent)); 2060 new InputMsg_SelectRange(focused_frame->GetRoutingID(), base, extent));
2061 } 2061 }
2062 2062
2063 void WebContentsImpl::AdjustSelectionByCharacterOffset(int start_adjust,
2064 int end_adjust) {
2065 RenderFrameHost* focused_frame = GetFocusedFrame();
2066 if (!focused_frame)
2067 return;
2068
2069 focused_frame->Send(new InputMsg_AdjustSelectionByCharacterOffset(
2070 focused_frame->GetRoutingID(), start_adjust, end_adjust));
2071 }
2072
2063 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) { 2073 void WebContentsImpl::UpdatePreferredSize(const gfx::Size& pref_size) {
2064 const gfx::Size old_size = GetPreferredSize(); 2074 const gfx::Size old_size = GetPreferredSize();
2065 preferred_size_ = pref_size; 2075 preferred_size_ = pref_size;
2066 OnPreferredSizeChanged(old_size); 2076 OnPreferredSizeChanged(old_size);
2067 } 2077 }
2068 2078
2069 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) { 2079 void WebContentsImpl::ResizeDueToAutoResize(const gfx::Size& new_size) {
2070 if (delegate_) 2080 if (delegate_)
2071 delegate_->ResizeDueToAutoResize(this, new_size); 2081 delegate_->ResizeDueToAutoResize(this, new_size);
2072 } 2082 }
(...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after
4491 player_map->erase(it); 4501 player_map->erase(it);
4492 } 4502 }
4493 4503
4494 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4504 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4495 force_disable_overscroll_content_ = force_disable; 4505 force_disable_overscroll_content_ = force_disable;
4496 if (view_) 4506 if (view_)
4497 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4507 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4498 } 4508 }
4499 4509
4500 } // namespace content 4510 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698