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" | |
18 #include "base/feature_list.h" | 17 #include "base/feature_list.h" |
19 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
20 #include "base/i18n/rtl.h" | 19 #include "base/i18n/rtl.h" |
21 #include "base/json/json_writer.h" | 20 #include "base/json/json_writer.h" |
22 #include "base/lazy_instance.h" | 21 #include "base/lazy_instance.h" |
23 #include "base/location.h" | 22 #include "base/location.h" |
24 #include "base/memory/ptr_util.h" | 23 #include "base/memory/ptr_util.h" |
25 #include "base/metrics/field_trial.h" | 24 #include "base/metrics/field_trial.h" |
26 #include "base/metrics/histogram_macros.h" | 25 #include "base/metrics/histogram_macros.h" |
27 #include "base/process/kill.h" | 26 #include "base/process/kill.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 | 618 |
620 g_view_map.Get().insert(std::make_pair(webview(), this)); | 619 g_view_map.Get().insert(std::make_pair(webview(), this)); |
621 g_routing_id_view_map.Get().insert(std::make_pair(GetRoutingID(), this)); | 620 g_routing_id_view_map.Get().insert(std::make_pair(GetRoutingID(), this)); |
622 | 621 |
623 const base::CommandLine& command_line = | 622 const base::CommandLine& command_line = |
624 *base::CommandLine::ForCurrentProcess(); | 623 *base::CommandLine::ForCurrentProcess(); |
625 | 624 |
626 if (command_line.HasSwitch(switches::kStatsCollectionController)) | 625 if (command_line.HasSwitch(switches::kStatsCollectionController)) |
627 stats_collection_observer_.reset(new StatsCollectionObserver(this)); | 626 stats_collection_observer_.reset(new StatsCollectionObserver(this)); |
628 | 627 |
629 // Debug cases of https://crbug.com/575245. | |
630 base::debug::SetCrashKeyValue("rvinit_view_id", | |
631 base::IntToString(GetRoutingID())); | |
632 base::debug::SetCrashKeyValue("rvinit_proxy_id", | |
633 base::IntToString(params.proxy_routing_id)); | |
634 base::debug::SetCrashKeyValue( | |
635 "rvinit_main_frame_id", base::IntToString(params.main_frame_routing_id)); | |
636 | |
637 webview()->SetDisplayMode(display_mode_); | 628 webview()->SetDisplayMode(display_mode_); |
638 webview()->GetSettings()->SetPreferCompositingToLCDTextEnabled( | 629 webview()->GetSettings()->SetPreferCompositingToLCDTextEnabled( |
639 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 630 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
640 webview()->GetSettings()->SetThreadedScrollingEnabled( | 631 webview()->GetSettings()->SetThreadedScrollingEnabled( |
641 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); | 632 !command_line.HasSwitch(switches::kDisableThreadedScrolling)); |
642 webview()->SetShowFPSCounter( | 633 webview()->SetShowFPSCounter( |
643 command_line.HasSwitch(cc::switches::kShowFPSCounter)); | 634 command_line.HasSwitch(cc::switches::kShowFPSCounter)); |
644 | 635 |
645 if (std::unique_ptr<gfx::ICCProfile> overridden_color_profile = | 636 if (std::unique_ptr<gfx::ICCProfile> overridden_color_profile = |
646 GetContentClient()->renderer()->GetImageDecodeColorProfile()) { | 637 GetContentClient()->renderer()->GetImageDecodeColorProfile()) { |
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 input_event.GetCoalescedEventsPointers(), latency_info, | 2660 input_event.GetCoalescedEventsPointers(), latency_info, |
2670 dispatch_type); | 2661 dispatch_type); |
2671 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 2662 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
2672 } | 2663 } |
2673 idle_user_detector_->ActivityDetected(); | 2664 idle_user_detector_->ActivityDetected(); |
2674 return RenderWidget::HandleInputEvent(input_event, latency_info, | 2665 return RenderWidget::HandleInputEvent(input_event, latency_info, |
2675 dispatch_type); | 2666 dispatch_type); |
2676 } | 2667 } |
2677 | 2668 |
2678 } // namespace content | 2669 } // namespace content |
OLD | NEW |