| 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 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1964 const display::Display& display = | 1964 const display::Display& display = |
| 1965 display::Screen::GetScreen()->GetPrimaryDisplay(); | 1965 display::Screen::GetScreen()->GetPrimaryDisplay(); |
| 1966 results->rect = display.bounds(); | 1966 results->rect = display.bounds(); |
| 1967 // TODO(husky): Remove any system controls from availableRect. | 1967 // TODO(husky): Remove any system controls from availableRect. |
| 1968 results->availableRect = display.work_area(); | 1968 results->availableRect = display.work_area(); |
| 1969 results->deviceScaleFactor = display.device_scale_factor(); | 1969 results->deviceScaleFactor = display.device_scale_factor(); |
| 1970 results->orientationAngle = display.RotationAsDegree(); | 1970 results->orientationAngle = display.RotationAsDegree(); |
| 1971 results->orientationType = | 1971 results->orientationType = |
| 1972 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1972 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1973 gfx::DeviceDisplayInfo info; | 1973 gfx::DeviceDisplayInfo info; |
| 1974 results->depth = info.GetBitsPerPixel(); | 1974 results->depth = display.bits_per_pixel(); |
| 1975 results->depthPerComponent = info.GetBitsPerComponent(); | 1975 results->depthPerComponent = display.bits_per_component(); |
| 1976 results->isMonochrome = (results->depthPerComponent == 0); | 1976 results->isMonochrome = (results->depthPerComponent == 0); |
| 1977 } | 1977 } |
| 1978 | 1978 |
| 1979 void RenderWidgetHostViewAndroid::ComputeEventLatencyOSTouchHistograms( | 1979 void RenderWidgetHostViewAndroid::ComputeEventLatencyOSTouchHistograms( |
| 1980 const ui::MotionEvent& event) { | 1980 const ui::MotionEvent& event) { |
| 1981 base::TimeTicks event_time = event.GetEventTime(); | 1981 base::TimeTicks event_time = event.GetEventTime(); |
| 1982 base::TimeDelta delta = base::TimeTicks::Now() - event_time; | 1982 base::TimeDelta delta = base::TimeTicks::Now() - event_time; |
| 1983 switch (event.GetAction()) { | 1983 switch (event.GetAction()) { |
| 1984 case ui::MotionEvent::ACTION_DOWN: | 1984 case ui::MotionEvent::ACTION_DOWN: |
| 1985 case ui::MotionEvent::ACTION_POINTER_DOWN: | 1985 case ui::MotionEvent::ACTION_POINTER_DOWN: |
| 1986 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_PRESSED", | 1986 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_PRESSED", |
| 1987 delta.InMicroseconds(), 1, 1000000, 50); | 1987 delta.InMicroseconds(), 1, 1000000, 50); |
| 1988 return; | 1988 return; |
| 1989 case ui::MotionEvent::ACTION_MOVE: | 1989 case ui::MotionEvent::ACTION_MOVE: |
| 1990 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_MOVED", | 1990 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_MOVED", |
| 1991 delta.InMicroseconds(), 1, 1000000, 50); | 1991 delta.InMicroseconds(), 1, 1000000, 50); |
| 1992 return; | 1992 return; |
| 1993 case ui::MotionEvent::ACTION_UP: | 1993 case ui::MotionEvent::ACTION_UP: |
| 1994 case ui::MotionEvent::ACTION_POINTER_UP: | 1994 case ui::MotionEvent::ACTION_POINTER_UP: |
| 1995 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1995 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 1996 delta.InMicroseconds(), 1, 1000000, 50); | 1996 delta.InMicroseconds(), 1, 1000000, 50); |
| 1997 default: | 1997 default: |
| 1998 return; | 1998 return; |
| 1999 } | 1999 } |
| 2000 } | 2000 } |
| 2001 | 2001 |
| 2002 } // namespace content | 2002 } // namespace content |
| OLD | NEW |