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

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

Issue 2496763002: Disable content intent detectors in the renderer (Closed)
Patch Set: Created 4 years, 1 month 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 2671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2682 main_render_frame_->Send(new FrameHostMsg_UpdatePageImportanceSignals( 2682 main_render_frame_->Send(new FrameHostMsg_UpdatePageImportanceSignals(
2683 main_render_frame_->GetRoutingID(), signals)); 2683 main_render_frame_->GetRoutingID(), signals));
2684 } 2684 }
2685 2685
2686 // TODO(dglazkov): Remove this ifdef. The content detection code 2686 // TODO(dglazkov): Remove this ifdef. The content detection code
2687 // should not be platform-specific. 2687 // should not be platform-specific.
2688 // See http://crbug.com/635214 for details. 2688 // See http://crbug.com/635214 for details.
2689 #if defined(OS_ANDROID) 2689 #if defined(OS_ANDROID)
2690 WebURL RenderViewImpl::detectContentIntentAt( 2690 WebURL RenderViewImpl::detectContentIntentAt(
2691 const WebHitTestResult& touch_hit) { 2691 const WebHitTestResult& touch_hit) {
2692 // TODO(twellington): Remove content detection entirely. It is
2693 // currently only enabled for tests. crbug.com/664307.
2694 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
2695 switches::kEnableContentIntentDetection)) {
2696 return WebURL();;
aelias_OOO_until_Jul13 2016/11/10 23:27:37 nit: duplicate whitespace and semicolons
Theresa 2016/11/10 23:32:19 Done.
2697 }
2692 DCHECK(touch_hit.node().isTextNode()); 2698 DCHECK(touch_hit.node().isTextNode());
2693 2699
2694 // Process the position with all the registered content detectors until 2700 // Process the position with all the registered content detectors until
2695 // a match is found. Priority is provided by their relative order. 2701 // a match is found. Priority is provided by their relative order.
2696 for (const auto& detector : content_detectors_) { 2702 for (const auto& detector : content_detectors_) {
2697 WebURL intent = detector->FindTappedContent(touch_hit); 2703 WebURL intent = detector->FindTappedContent(touch_hit);
2698 if (intent.isValid()) { 2704 if (intent.isValid()) {
2699 return intent; 2705 return intent;
2700 } 2706 }
2701 } 2707 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
2964 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 2970 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
2965 } 2971 }
2966 2972
2967 std::unique_ptr<InputEventAck> ack( 2973 std::unique_ptr<InputEventAck> ack(
2968 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, 2974 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type,
2969 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); 2975 INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
2970 OnInputEventAck(std::move(ack)); 2976 OnInputEventAck(std::move(ack));
2971 } 2977 }
2972 2978
2973 } // namespace content 2979 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698