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

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

Issue 1873783003: Convert //content/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/renderer/text_input_client_observer.h" 5 #include "content/renderer/text_input_client_observer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include <memory>
10
10 #include "build/build_config.h" 11 #include "build/build_config.h"
11 #include "content/common/text_input_client_messages.h" 12 #include "content/common/text_input_client_messages.h"
12 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 13 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
13 #include "content/renderer/render_view_impl.h" 14 #include "content/renderer/render_view_impl.h"
14 #include "third_party/WebKit/public/platform/WebPoint.h" 15 #include "third_party/WebKit/public/platform/WebPoint.h"
15 #include "third_party/WebKit/public/platform/WebRect.h" 16 #include "third_party/WebKit/public/platform/WebRect.h"
16 #include "third_party/WebKit/public/platform/WebString.h" 17 #include "third_party/WebKit/public/platform/WebString.h"
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" 18 #include "third_party/WebKit/public/web/WebLocalFrame.h"
18 #include "third_party/WebKit/public/web/WebView.h" 19 #include "third_party/WebKit/public/web/WebView.h"
19 #include "third_party/WebKit/public/web/mac/WebSubstringUtil.h" 20 #include "third_party/WebKit/public/web/mac/WebSubstringUtil.h"
(...skipping 27 matching lines...) Expand all
47 blink::WebView* TextInputClientObserver::webview() { 48 blink::WebView* TextInputClientObserver::webview() {
48 return render_view()->GetWebView(); 49 return render_view()->GetWebView();
49 } 50 }
50 51
51 void TextInputClientObserver::OnStringAtPoint(gfx::Point point) { 52 void TextInputClientObserver::OnStringAtPoint(gfx::Point point) {
52 #if defined(OS_MACOSX) 53 #if defined(OS_MACOSX)
53 blink::WebPoint baselinePoint; 54 blink::WebPoint baselinePoint;
54 NSAttributedString* string = blink::WebSubstringUtil::attributedWordAtPoint( 55 NSAttributedString* string = blink::WebSubstringUtil::attributedWordAtPoint(
55 webview(), point, baselinePoint); 56 webview(), point, baselinePoint);
56 57
57 scoped_ptr<const mac::AttributedStringCoder::EncodedString> encoded( 58 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded(
58 mac::AttributedStringCoder::Encode(string)); 59 mac::AttributedStringCoder::Encode(string));
59 Send(new TextInputClientReplyMsg_GotStringAtPoint( 60 Send(new TextInputClientReplyMsg_GotStringAtPoint(
60 routing_id(), *encoded.get(), baselinePoint)); 61 routing_id(), *encoded.get(), baselinePoint));
61 #else 62 #else
62 NOTIMPLEMENTED(); 63 NOTIMPLEMENTED();
63 #endif 64 #endif
64 } 65 }
65 66
66 void TextInputClientObserver::OnCharacterIndexForPoint(gfx::Point point) { 67 void TextInputClientObserver::OnCharacterIndexForPoint(gfx::Point point) {
67 blink::WebPoint web_point(point); 68 blink::WebPoint web_point(point);
(...skipping 24 matching lines...) Expand all
92 93
93 void TextInputClientObserver::OnStringForRange(gfx::Range range) { 94 void TextInputClientObserver::OnStringForRange(gfx::Range range) {
94 #if defined(OS_MACOSX) 95 #if defined(OS_MACOSX)
95 blink::WebPoint baselinePoint; 96 blink::WebPoint baselinePoint;
96 NSAttributedString* string = nil; 97 NSAttributedString* string = nil;
97 blink::WebLocalFrame* frame = webview()->focusedFrame()->toWebLocalFrame(); 98 blink::WebLocalFrame* frame = webview()->focusedFrame()->toWebLocalFrame();
98 if (frame) { 99 if (frame) {
99 string = blink::WebSubstringUtil::attributedSubstringInRange( 100 string = blink::WebSubstringUtil::attributedSubstringInRange(
100 frame, range.start(), range.length(), &baselinePoint); 101 frame, range.start(), range.length(), &baselinePoint);
101 } 102 }
102 scoped_ptr<const mac::AttributedStringCoder::EncodedString> encoded( 103 std::unique_ptr<const mac::AttributedStringCoder::EncodedString> encoded(
103 mac::AttributedStringCoder::Encode(string)); 104 mac::AttributedStringCoder::Encode(string));
104 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(), 105 Send(new TextInputClientReplyMsg_GotStringForRange(routing_id(),
105 *encoded.get(), baselinePoint)); 106 *encoded.get(), baselinePoint));
106 #else 107 #else
107 NOTIMPLEMENTED(); 108 NOTIMPLEMENTED();
108 #endif 109 #endif
109 } 110 }
110 111
111 } // namespace content 112 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/speech_recognition_dispatcher.cc ('k') | content/renderer/usb/web_usb_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698