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

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

Issue 2222813002: Remove the use of WebRange in ContentDetector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Maybe now fix compile. Created 4 years, 4 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/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 2795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2806 // should not be platform-specific. 2806 // should not be platform-specific.
2807 // See http://crbug.com/635214 for details. 2807 // See http://crbug.com/635214 for details.
2808 #if defined(OS_ANDROID) 2808 #if defined(OS_ANDROID)
2809 WebURL RenderViewImpl::detectContentIntentAt( 2809 WebURL RenderViewImpl::detectContentIntentAt(
2810 const WebHitTestResult& touch_hit) { 2810 const WebHitTestResult& touch_hit) {
2811 DCHECK(touch_hit.node().isTextNode()); 2811 DCHECK(touch_hit.node().isTextNode());
2812 2812
2813 // Process the position with all the registered content detectors until 2813 // Process the position with all the registered content detectors until
2814 // a match is found. Priority is provided by their relative order. 2814 // a match is found. Priority is provided by their relative order.
2815 for (const auto& detector : content_detectors_) { 2815 for (const auto& detector : content_detectors_) {
2816 ContentDetector::Result content = detector->FindTappedContent(touch_hit); 2816 WebURL intent = detector->FindTappedContent(touch_hit);
2817 if (content.valid) { 2817 if (intent.isValid()) {
2818 return content.intent_url; 2818 return intent;
2819 } 2819 }
2820 } 2820 }
2821 return WebURL(); 2821 return WebURL();
2822 } 2822 }
2823 2823
2824 void RenderViewImpl::scheduleContentIntent(const WebURL& intent, 2824 void RenderViewImpl::scheduleContentIntent(const WebURL& intent,
2825 bool is_main_frame) { 2825 bool is_main_frame) {
2826 // Introduce a short delay so that the user can notice the content. 2826 // Introduce a short delay so that the user can notice the content.
2827 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 2827 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
2828 FROM_HERE, 2828 FROM_HERE,
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
3080 return render_frame->focused_pepper_plugin(); 3080 return render_frame->focused_pepper_plugin();
3081 } 3081 }
3082 frame = frame->traverseNext(false); 3082 frame = frame->traverseNext(false);
3083 } 3083 }
3084 3084
3085 return nullptr; 3085 return nullptr;
3086 } 3086 }
3087 #endif 3087 #endif
3088 3088
3089 } // namespace content 3089 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/android/content_detector.cc ('k') | third_party/WebKit/Source/core/editing/SurroundingText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698