| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 bool RenderFrameImpl::ShouldUpdateSelectionTextFromContextMenuParams( | 799 bool RenderFrameImpl::ShouldUpdateSelectionTextFromContextMenuParams( |
| 800 const base::string16& selection_text, | 800 const base::string16& selection_text, |
| 801 size_t selection_text_offset, | 801 size_t selection_text_offset, |
| 802 const gfx::Range& selection_range, | 802 const gfx::Range& selection_range, |
| 803 const ContextMenuParams& params) { | 803 const ContextMenuParams& params) { |
| 804 base::string16 trimmed_selection_text; | 804 base::string16 trimmed_selection_text; |
| 805 if (!selection_text.empty() && !selection_range.is_empty()) { | 805 if (!selection_text.empty() && !selection_range.is_empty()) { |
| 806 const int start = selection_range.GetMin() - selection_text_offset; | 806 const int start = selection_range.GetMin() - selection_text_offset; |
| 807 const size_t length = selection_range.length(); | 807 const size_t length = selection_range.length(); |
| 808 if (start >= 0 && start + length <= selection_text.length()) { | 808 if (start >= 0 && start + length <= selection_text.length()) { |
| 809 TrimWhitespace(selection_text.substr(start, length), TRIM_ALL, | 809 base::TrimWhitespace(selection_text.substr(start, length), base::TRIM_ALL, |
| 810 &trimmed_selection_text); | 810 &trimmed_selection_text); |
| 811 } | 811 } |
| 812 } | 812 } |
| 813 base::string16 trimmed_params_text; | 813 base::string16 trimmed_params_text; |
| 814 TrimWhitespace(params.selection_text, TRIM_ALL, &trimmed_params_text); | 814 base::TrimWhitespace(params.selection_text, base::TRIM_ALL, |
| 815 &trimmed_params_text); |
| 815 return trimmed_params_text != trimmed_selection_text; | 816 return trimmed_params_text != trimmed_selection_text; |
| 816 } | 817 } |
| 817 | 818 |
| 818 void RenderFrameImpl::DidCommitCompositorFrame() { | 819 void RenderFrameImpl::DidCommitCompositorFrame() { |
| 819 if (compositing_helper_) | 820 if (compositing_helper_) |
| 820 compositing_helper_->DidCommitCompositorFrame(); | 821 compositing_helper_->DidCommitCompositorFrame(); |
| 821 } | 822 } |
| 822 | 823 |
| 823 RenderView* RenderFrameImpl::GetRenderView() { | 824 RenderView* RenderFrameImpl::GetRenderView() { |
| 824 return render_view_.get(); | 825 return render_view_.get(); |
| (...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2275 | 2276 |
| 2276 void RenderFrameImpl::didStartLoading() { | 2277 void RenderFrameImpl::didStartLoading() { |
| 2277 Send(new FrameHostMsg_DidStartLoading(routing_id_)); | 2278 Send(new FrameHostMsg_DidStartLoading(routing_id_)); |
| 2278 } | 2279 } |
| 2279 | 2280 |
| 2280 void RenderFrameImpl::didStopLoading() { | 2281 void RenderFrameImpl::didStopLoading() { |
| 2281 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | 2282 Send(new FrameHostMsg_DidStopLoading(routing_id_)); |
| 2282 } | 2283 } |
| 2283 | 2284 |
| 2284 } // namespace content | 2285 } // namespace content |
| OLD | NEW |