OLD | NEW |
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 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 6268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6279 if (content.valid) { | 6279 if (content.valid) { |
6280 return WebContentDetectionResult(content.content_boundaries, | 6280 return WebContentDetectionResult(content.content_boundaries, |
6281 UTF8ToUTF16(content.text), content.intent_url); | 6281 UTF8ToUTF16(content.text), content.intent_url); |
6282 } | 6282 } |
6283 } | 6283 } |
6284 return WebContentDetectionResult(); | 6284 return WebContentDetectionResult(); |
6285 } | 6285 } |
6286 | 6286 |
6287 void RenderViewImpl::scheduleContentIntent(const WebURL& intent) { | 6287 void RenderViewImpl::scheduleContentIntent(const WebURL& intent) { |
6288 // Introduce a short delay so that the user can notice the content. | 6288 // Introduce a short delay so that the user can notice the content. |
6289 MessageLoop::current()->PostDelayedTask( | 6289 base::MessageLoop::current()->PostDelayedTask( |
6290 FROM_HERE, | 6290 FROM_HERE, |
6291 base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, AsWeakPtr(), | 6291 base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, |
6292 intent, expected_content_intent_id_), | 6292 AsWeakPtr(), |
| 6293 intent, |
| 6294 expected_content_intent_id_), |
6293 base::TimeDelta::FromMilliseconds(kContentIntentDelayMilliseconds)); | 6295 base::TimeDelta::FromMilliseconds(kContentIntentDelayMilliseconds)); |
6294 } | 6296 } |
6295 | 6297 |
6296 void RenderViewImpl::cancelScheduledContentIntents() { | 6298 void RenderViewImpl::cancelScheduledContentIntents() { |
6297 ++expected_content_intent_id_; | 6299 ++expected_content_intent_id_; |
6298 } | 6300 } |
6299 | 6301 |
6300 void RenderViewImpl::LaunchAndroidContentIntent(const GURL& intent, | 6302 void RenderViewImpl::LaunchAndroidContentIntent(const GURL& intent, |
6301 size_t request_id) { | 6303 size_t request_id) { |
6302 if (request_id != expected_content_intent_id_) | 6304 if (request_id != expected_content_intent_id_) |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6527 WebURL url = icon_urls[i].iconURL(); | 6529 WebURL url = icon_urls[i].iconURL(); |
6528 if (!url.isEmpty()) | 6530 if (!url.isEmpty()) |
6529 urls.push_back(FaviconURL(url, | 6531 urls.push_back(FaviconURL(url, |
6530 ToFaviconType(icon_urls[i].iconType()))); | 6532 ToFaviconType(icon_urls[i].iconType()))); |
6531 } | 6533 } |
6532 SendUpdateFaviconURL(urls); | 6534 SendUpdateFaviconURL(urls); |
6533 } | 6535 } |
6534 | 6536 |
6535 | 6537 |
6536 } // namespace content | 6538 } // namespace content |
OLD | NEW |