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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 #include "ui/gfx/rect.h" | 197 #include "ui/gfx/rect.h" |
198 #include "ui/gfx/rect_conversions.h" | 198 #include "ui/gfx/rect_conversions.h" |
199 #include "ui/gfx/size_conversions.h" | 199 #include "ui/gfx/size_conversions.h" |
200 #include "ui/shell_dialogs/selected_file_info.h" | 200 #include "ui/shell_dialogs/selected_file_info.h" |
201 #include "v8/include/v8.h" | 201 #include "v8/include/v8.h" |
202 #include "webkit/child/weburlresponse_extradata_impl.h" | 202 #include "webkit/child/weburlresponse_extradata_impl.h" |
203 | 203 |
204 #if defined(OS_ANDROID) | 204 #if defined(OS_ANDROID) |
205 #include <cpu-features.h> | 205 #include <cpu-features.h> |
206 | 206 |
207 #include "content/common/android/device_telephony_info.h" | |
208 #include "content/common/gpu/client/context_provider_command_buffer.h" | 207 #include "content/common/gpu/client/context_provider_command_buffer.h" |
209 #include "content/renderer/android/address_detector.h" | 208 #include "content/renderer/android/address_detector.h" |
210 #include "content/renderer/android/content_detector.h" | 209 #include "content/renderer/android/content_detector.h" |
211 #include "content/renderer/android/email_detector.h" | 210 #include "content/renderer/android/email_detector.h" |
212 #include "content/renderer/android/phone_number_detector.h" | 211 #include "content/renderer/android/phone_number_detector.h" |
213 #include "content/renderer/android/synchronous_compositor_factory.h" | 212 #include "content/renderer/android/synchronous_compositor_factory.h" |
214 #include "content/renderer/media/android/renderer_media_player_manager.h" | 213 #include "content/renderer/media/android/renderer_media_player_manager.h" |
215 #include "content/renderer/media/android/stream_texture_factory_impl.h" | 214 #include "content/renderer/media/android/stream_texture_factory_impl.h" |
216 #include "content/renderer/media/android/webmediaplayer_android.h" | 215 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 216 #include "net/android/network_library.h" |
217 #include "skia/ext/platform_canvas.h" | 217 #include "skia/ext/platform_canvas.h" |
218 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 218 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
219 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 219 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
220 #include "third_party/WebKit/public/web/WebHitTestResult.h" | 220 #include "third_party/WebKit/public/web/WebHitTestResult.h" |
221 #include "ui/gfx/rect_f.h" | 221 #include "ui/gfx/rect_f.h" |
222 | 222 |
223 #elif defined(OS_WIN) | 223 #elif defined(OS_WIN) |
224 // TODO(port): these files are currently Windows only because they concern: | 224 // TODO(port): these files are currently Windows only because they concern: |
225 // * theming | 225 // * theming |
226 #include "ui/native_theme/native_theme_win.h" | 226 #include "ui/native_theme/native_theme_win.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 | 721 |
722 webwidget_ = WebView::create(this); | 722 webwidget_ = WebView::create(this); |
723 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); | 723 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); |
724 | 724 |
725 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 725 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
726 | 726 |
727 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 727 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
728 stats_collection_observer_.reset(new StatsCollectionObserver(this)); | 728 stats_collection_observer_.reset(new StatsCollectionObserver(this)); |
729 | 729 |
730 #if defined(OS_ANDROID) | 730 #if defined(OS_ANDROID) |
731 content::DeviceTelephonyInfo device_info; | |
732 | |
733 const std::string region_code = | 731 const std::string region_code = |
734 command_line.HasSwitch(switches::kNetworkCountryIso) | 732 command_line.HasSwitch(switches::kNetworkCountryIso) |
735 ? command_line.GetSwitchValueASCII(switches::kNetworkCountryIso) | 733 ? command_line.GetSwitchValueASCII(switches::kNetworkCountryIso) |
736 : device_info.GetNetworkCountryIso(); | 734 : net::android::GetTelephonyNetworkOperator(); |
737 content_detectors_.push_back(linked_ptr<ContentDetector>( | 735 content_detectors_.push_back(linked_ptr<ContentDetector>( |
738 new AddressDetector())); | 736 new AddressDetector())); |
739 content_detectors_.push_back(linked_ptr<ContentDetector>( | 737 content_detectors_.push_back(linked_ptr<ContentDetector>( |
740 new PhoneNumberDetector(region_code))); | 738 new PhoneNumberDetector(region_code))); |
741 content_detectors_.push_back(linked_ptr<ContentDetector>( | 739 content_detectors_.push_back(linked_ptr<ContentDetector>( |
742 new EmailDetector())); | 740 new EmailDetector())); |
743 #endif | 741 #endif |
744 | 742 |
745 RenderThread::Get()->AddRoute(routing_id_, this); | 743 RenderThread::Get()->AddRoute(routing_id_, this); |
746 // Take a reference on behalf of the RenderThread. This will be balanced | 744 // Take a reference on behalf of the RenderThread. This will be balanced |
(...skipping 3646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4393 std::vector<gfx::Size> sizes; | 4391 std::vector<gfx::Size> sizes; |
4394 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4392 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4395 if (!url.isEmpty()) | 4393 if (!url.isEmpty()) |
4396 urls.push_back( | 4394 urls.push_back( |
4397 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4395 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4398 } | 4396 } |
4399 SendUpdateFaviconURL(urls); | 4397 SendUpdateFaviconURL(urls); |
4400 } | 4398 } |
4401 | 4399 |
4402 } // namespace content | 4400 } // namespace content |
OLD | NEW |