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

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

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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
« no previous file with comments | « content/renderer/render_thread_impl_browsertest.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl_browsertest.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698