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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 bool RenderFrameImpl::ShouldUpdateSelectionTextFromContextMenuParams( 550 bool RenderFrameImpl::ShouldUpdateSelectionTextFromContextMenuParams(
551 const base::string16& selection_text, 551 const base::string16& selection_text,
552 size_t selection_text_offset, 552 size_t selection_text_offset,
553 const gfx::Range& selection_range, 553 const gfx::Range& selection_range,
554 const ContextMenuParams& params) { 554 const ContextMenuParams& params) {
555 base::string16 trimmed_selection_text; 555 base::string16 trimmed_selection_text;
556 if (!selection_text.empty() && !selection_range.is_empty()) { 556 if (!selection_text.empty() && !selection_range.is_empty()) {
557 const int start = selection_range.GetMin() - selection_text_offset; 557 const int start = selection_range.GetMin() - selection_text_offset;
558 const size_t length = selection_range.length(); 558 const size_t length = selection_range.length();
559 if (start >= 0 && start + length <= selection_text.length()) { 559 if (start >= 0 && start + length <= selection_text.length()) {
560 TrimWhitespace(selection_text.substr(start, length), TRIM_ALL, 560 base::TrimWhitespace(selection_text.substr(start, length), base::TRIM_ALL,
561 &trimmed_selection_text); 561 &trimmed_selection_text);
562 } 562 }
563 } 563 }
564 base::string16 trimmed_params_text; 564 base::string16 trimmed_params_text;
565 TrimWhitespace(params.selection_text, TRIM_ALL, &trimmed_params_text); 565 base::TrimWhitespace(params.selection_text, base::TRIM_ALL,
566 &trimmed_params_text);
566 return trimmed_params_text != trimmed_selection_text; 567 return trimmed_params_text != trimmed_selection_text;
567 } 568 }
568 569
569 void RenderFrameImpl::DidCommitCompositorFrame() { 570 void RenderFrameImpl::DidCommitCompositorFrame() {
570 if (compositing_helper_) 571 if (compositing_helper_)
571 compositing_helper_->DidCommitCompositorFrame(); 572 compositing_helper_->DidCommitCompositorFrame();
572 } 573 }
573 574
574 RenderView* RenderFrameImpl::GetRenderView() { 575 RenderView* RenderFrameImpl::GetRenderView() {
575 return render_view_.get(); 576 return render_view_.get();
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 2026
2026 void RenderFrameImpl::didStartLoading() { 2027 void RenderFrameImpl::didStartLoading() {
2027 Send(new FrameHostMsg_DidStartLoading(routing_id_)); 2028 Send(new FrameHostMsg_DidStartLoading(routing_id_));
2028 } 2029 }
2029 2030
2030 void RenderFrameImpl::didStopLoading() { 2031 void RenderFrameImpl::didStopLoading() {
2031 Send(new FrameHostMsg_DidStopLoading(routing_id_)); 2032 Send(new FrameHostMsg_DidStopLoading(routing_id_));
2032 } 2033 }
2033 2034
2034 } // namespace content 2035 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698