summaryrefslogtreecommitdiff
path: root/chromium/ui/display/manager/display_change_observer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/display/manager/display_change_observer.cc')
-rw-r--r--chromium/ui/display/manager/display_change_observer.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/chromium/ui/display/manager/display_change_observer.cc b/chromium/ui/display/manager/display_change_observer.cc
index e9064681170..e99d15e4240 100644
--- a/chromium/ui/display/manager/display_change_observer.cc
+++ b/chromium/ui/display/manager/display_change_observer.cc
@@ -12,6 +12,7 @@
#include <vector>
#include "base/logging.h"
+#include "base/stl_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/user_activity/user_activity_detector.h"
#include "ui/display/display.h"
@@ -199,15 +200,18 @@ void DisplayChangeObserver::OnDisplayModeChangeFailed(
OnDisplayModeChanged(displays);
}
-void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() {
- // If there are no cached display snapshots, either there are no attached
- // displays or the cached snapshots have been invalidated. For the first case
- // there aren't any touchscreens to associate. For the second case, the
- // displays and touch input-devices will get associated when display
- // configuration finishes.
- const auto& cached_displays = display_configurator_->cached_displays();
- if (!cached_displays.empty())
- OnDisplayModeChanged(cached_displays);
+void DisplayChangeObserver::OnInputDeviceConfigurationChanged(
+ uint8_t input_device_types) {
+ if (input_device_types & ui::InputDeviceEventObserver::kTouchscreen) {
+ // If there are no cached display snapshots, either there are no attached
+ // displays or the cached snapshots have been invalidated. For the first
+ // case there aren't any touchscreens to associate. For the second case,
+ // the displays and touch input-devices will get associated when display
+ // configuration finishes.
+ const auto& cached_displays = display_configurator_->cached_displays();
+ if (!cached_displays.empty())
+ OnDisplayModeChanged(cached_displays);
+ }
}
void DisplayChangeObserver::UpdateInternalDisplay(
@@ -313,7 +317,7 @@ ManagedDisplayInfo DisplayChangeObserver::CreateManagedDisplayInfo(
// static
float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) {
- for (size_t i = 0; i < arraysize(kThresholdTableForInternal); ++i) {
+ for (size_t i = 0; i < base::size(kThresholdTableForInternal); ++i) {
if (dpi > kThresholdTableForInternal[i].dpi)
return kThresholdTableForInternal[i].device_scale_factor;
}