| 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/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 const display::Display& display = | 1953 const display::Display& display = |
| 1954 display::Screen::GetScreen()->GetPrimaryDisplay(); | 1954 display::Screen::GetScreen()->GetPrimaryDisplay(); |
| 1955 results->rect = display.bounds(); | 1955 results->rect = display.bounds(); |
| 1956 // TODO(husky): Remove any system controls from availableRect. | 1956 // TODO(husky): Remove any system controls from availableRect. |
| 1957 results->availableRect = display.work_area(); | 1957 results->availableRect = display.work_area(); |
| 1958 results->deviceScaleFactor = display.device_scale_factor(); | 1958 results->deviceScaleFactor = display.device_scale_factor(); |
| 1959 results->orientationAngle = display.RotationAsDegree(); | 1959 results->orientationAngle = display.RotationAsDegree(); |
| 1960 results->orientationType = | 1960 results->orientationType = |
| 1961 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1961 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1962 gfx::DeviceDisplayInfo info; | 1962 gfx::DeviceDisplayInfo info; |
| 1963 results->depth = info.GetBitsPerPixel(); | 1963 results->depth = display.color_depth(); |
| 1964 results->depthPerComponent = info.GetBitsPerComponent(); | 1964 results->depthPerComponent = display.depth_per_component(); |
| 1965 results->isMonochrome = (results->depthPerComponent == 0); | 1965 results->isMonochrome = (results->depthPerComponent == 0); |
| 1966 } | 1966 } |
| 1967 | 1967 |
| 1968 void RenderWidgetHostViewAndroid::ComputeEventLatencyOSTouchHistograms( | 1968 void RenderWidgetHostViewAndroid::ComputeEventLatencyOSTouchHistograms( |
| 1969 const ui::MotionEvent& event) { | 1969 const ui::MotionEvent& event) { |
| 1970 base::TimeTicks event_time = event.GetEventTime(); | 1970 base::TimeTicks event_time = event.GetEventTime(); |
| 1971 base::TimeDelta delta = base::TimeTicks::Now() - event_time; | 1971 base::TimeDelta delta = base::TimeTicks::Now() - event_time; |
| 1972 switch (event.GetAction()) { | 1972 switch (event.GetAction()) { |
| 1973 case ui::MotionEvent::ACTION_DOWN: | 1973 case ui::MotionEvent::ACTION_DOWN: |
| 1974 case ui::MotionEvent::ACTION_POINTER_DOWN: | 1974 case ui::MotionEvent::ACTION_POINTER_DOWN: |
| 1975 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_PRESSED", | 1975 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_PRESSED", |
| 1976 delta.InMicroseconds(), 1, 1000000, 50); | 1976 delta.InMicroseconds(), 1, 1000000, 50); |
| 1977 return; | 1977 return; |
| 1978 case ui::MotionEvent::ACTION_MOVE: | 1978 case ui::MotionEvent::ACTION_MOVE: |
| 1979 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_MOVED", | 1979 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_MOVED", |
| 1980 delta.InMicroseconds(), 1, 1000000, 50); | 1980 delta.InMicroseconds(), 1, 1000000, 50); |
| 1981 return; | 1981 return; |
| 1982 case ui::MotionEvent::ACTION_UP: | 1982 case ui::MotionEvent::ACTION_UP: |
| 1983 case ui::MotionEvent::ACTION_POINTER_UP: | 1983 case ui::MotionEvent::ACTION_POINTER_UP: |
| 1984 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1984 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 1985 delta.InMicroseconds(), 1, 1000000, 50); | 1985 delta.InMicroseconds(), 1, 1000000, 50); |
| 1986 default: | 1986 default: |
| 1987 return; | 1987 return; |
| 1988 } | 1988 } |
| 1989 } | 1989 } |
| 1990 | 1990 |
| 1991 } // namespace content | 1991 } // namespace content |
| OLD | NEW |