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 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/debug/alias.h" | 16 #include "base/debug/alias.h" |
17 #include "base/debug/crash_logging.h" | 17 #include "base/debug/crash_logging.h" |
18 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
19 #include "base/i18n/rtl.h" | 19 #include "base/i18n/rtl.h" |
20 #include "base/json/json_writer.h" | 20 #include "base/json/json_writer.h" |
21 #include "base/lazy_instance.h" | 21 #include "base/lazy_instance.h" |
| 22 #include "base/location.h" |
22 #include "base/memory/ptr_util.h" | 23 #include "base/memory/ptr_util.h" |
23 #include "base/metrics/field_trial.h" | 24 #include "base/metrics/field_trial.h" |
24 #include "base/metrics/histogram.h" | 25 #include "base/metrics/histogram.h" |
25 #include "base/process/kill.h" | 26 #include "base/process/kill.h" |
26 #include "base/process/process.h" | 27 #include "base/process/process.h" |
| 28 #include "base/single_thread_task_runner.h" |
27 #include "base/strings/string_number_conversions.h" | 29 #include "base/strings/string_number_conversions.h" |
28 #include "base/strings/string_piece.h" | 30 #include "base/strings/string_piece.h" |
29 #include "base/strings/string_split.h" | 31 #include "base/strings/string_split.h" |
30 #include "base/strings/string_util.h" | 32 #include "base/strings/string_util.h" |
31 #include "base/strings/sys_string_conversions.h" | 33 #include "base/strings/sys_string_conversions.h" |
32 #include "base/strings/utf_string_conversions.h" | 34 #include "base/strings/utf_string_conversions.h" |
| 35 #include "base/threading/thread_task_runner_handle.h" |
33 #include "base/time/time.h" | 36 #include "base/time/time.h" |
34 #include "base/trace_event/trace_event.h" | 37 #include "base/trace_event/trace_event.h" |
35 #include "build/build_config.h" | 38 #include "build/build_config.h" |
36 #include "cc/base/switches.h" | 39 #include "cc/base/switches.h" |
37 #include "content/child/appcache/appcache_dispatcher.h" | 40 #include "content/child/appcache/appcache_dispatcher.h" |
38 #include "content/child/appcache/web_application_cache_host_impl.h" | 41 #include "content/child/appcache/web_application_cache_host_impl.h" |
39 #include "content/child/child_shared_bitmap_manager.h" | 42 #include "content/child/child_shared_bitmap_manager.h" |
40 #include "content/child/request_extra_data.h" | 43 #include "content/child/request_extra_data.h" |
41 #include "content/child/v8_value_converter_impl.h" | 44 #include "content/child/v8_value_converter_impl.h" |
42 #include "content/child/webmessageportchannel_impl.h" | 45 #include "content/child/webmessageportchannel_impl.h" |
(...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3129 return WebContentDetectionResult(content.content_boundaries, | 3132 return WebContentDetectionResult(content.content_boundaries, |
3130 base::UTF8ToUTF16(content.text), content.intent_url); | 3133 base::UTF8ToUTF16(content.text), content.intent_url); |
3131 } | 3134 } |
3132 } | 3135 } |
3133 return WebContentDetectionResult(); | 3136 return WebContentDetectionResult(); |
3134 } | 3137 } |
3135 | 3138 |
3136 void RenderViewImpl::scheduleContentIntent(const WebURL& intent, | 3139 void RenderViewImpl::scheduleContentIntent(const WebURL& intent, |
3137 bool is_main_frame) { | 3140 bool is_main_frame) { |
3138 // Introduce a short delay so that the user can notice the content. | 3141 // Introduce a short delay so that the user can notice the content. |
3139 base::MessageLoop::current()->PostDelayedTask( | 3142 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
3140 FROM_HERE, | 3143 FROM_HERE, |
3141 base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, AsWeakPtr(), | 3144 base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, AsWeakPtr(), |
3142 intent, expected_content_intent_id_, is_main_frame), | 3145 intent, expected_content_intent_id_, is_main_frame), |
3143 base::TimeDelta::FromMilliseconds(kContentIntentDelayMilliseconds)); | 3146 base::TimeDelta::FromMilliseconds(kContentIntentDelayMilliseconds)); |
3144 } | 3147 } |
3145 | 3148 |
3146 void RenderViewImpl::cancelScheduledContentIntents() { | 3149 void RenderViewImpl::cancelScheduledContentIntents() { |
3147 ++expected_content_intent_id_; | 3150 ++expected_content_intent_id_; |
3148 } | 3151 } |
3149 | 3152 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3392 return render_frame->focused_pepper_plugin(); | 3395 return render_frame->focused_pepper_plugin(); |
3393 } | 3396 } |
3394 frame = frame->traverseNext(false); | 3397 frame = frame->traverseNext(false); |
3395 } | 3398 } |
3396 | 3399 |
3397 return nullptr; | 3400 return nullptr; |
3398 } | 3401 } |
3399 #endif | 3402 #endif |
3400 | 3403 |
3401 } // namespace content | 3404 } // namespace content |
OLD | NEW |