Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: ash/display/display_change_observer_chromeos.cc

Issue 833893003: Move UserActivityDetector to ui/base/user_activity/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't build test on android Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/display/display_change_observer_chromeos.h" 5 #include "ash/display/display_change_observer_chromeos.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/ash_switches.h" 14 #include "ash/ash_switches.h"
15 #include "ash/display/display_info.h" 15 #include "ash/display/display_info.h"
16 #include "ash/display/display_layout_store.h" 16 #include "ash/display/display_layout_store.h"
17 #include "ash/display/display_manager.h" 17 #include "ash/display/display_manager.h"
18 #include "ash/display/display_util.h" 18 #include "ash/display/display_util.h"
19 #include "ash/shell.h" 19 #include "ash/shell.h"
20 #include "ash/touch/touchscreen_util.h" 20 #include "ash/touch/touchscreen_util.h"
21 #include "base/command_line.h" 21 #include "base/command_line.h"
22 #include "base/logging.h" 22 #include "base/logging.h"
23 #include "grit/ash_strings.h" 23 #include "grit/ash_strings.h"
24 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/base/user_activity/user_activity_detector.h"
25 #include "ui/compositor/dip_util.h" 26 #include "ui/compositor/dip_util.h"
26 #include "ui/display/types/display_mode.h" 27 #include "ui/display/types/display_mode.h"
27 #include "ui/display/types/display_snapshot.h" 28 #include "ui/display/types/display_snapshot.h"
28 #include "ui/display/util/display_util.h" 29 #include "ui/display/util/display_util.h"
29 #include "ui/events/devices/device_data_manager.h" 30 #include "ui/events/devices/device_data_manager.h"
30 #include "ui/events/devices/touchscreen_device.h" 31 #include "ui/events/devices/touchscreen_device.h"
31 #include "ui/gfx/display.h" 32 #include "ui/gfx/display.h"
32 #include "ui/wm/core/user_activity_detector.h"
33 33
34 namespace ash { 34 namespace ash {
35 35
36 using ui::DisplayConfigurator; 36 using ui::DisplayConfigurator;
37 37
38 namespace { 38 namespace {
39 39
40 // The DPI threshold to determine the device scale factor. 40 // The DPI threshold to determine the device scale factor.
41 // DPI higher than |dpi| will use |device_scale_factor|. 41 // DPI higher than |dpi| will use |device_scale_factor|.
42 struct DeviceScaleFactorDPIThreshold { 42 struct DeviceScaleFactorDPIThreshold {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 ->GetAvailableColorCalibrationProfiles(id)); 242 ->GetAvailableColorCalibrationProfiles(id));
243 } 243 }
244 244
245 AssociateTouchscreens( 245 AssociateTouchscreens(
246 &displays, ui::DeviceDataManager::GetInstance()->touchscreen_devices()); 246 &displays, ui::DeviceDataManager::GetInstance()->touchscreen_devices());
247 // DisplayManager can be null during the boot. 247 // DisplayManager can be null during the boot.
248 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); 248 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays);
249 249
250 // For the purposes of user activity detection, ignore synthetic mouse events 250 // For the purposes of user activity detection, ignore synthetic mouse events
251 // that are triggered by screen resizes: http://crbug.com/360634 251 // that are triggered by screen resizes: http://crbug.com/360634
252 ::wm::UserActivityDetector* user_activity_detector = 252 ui::UserActivityDetector* user_activity_detector =
253 ::wm::UserActivityDetector::Get(); 253 ui::UserActivityDetector::Get();
254 if (user_activity_detector) 254 if (user_activity_detector)
255 user_activity_detector->OnDisplayPowerChanging(); 255 user_activity_detector->OnDisplayPowerChanging();
256 } 256 }
257 257
258 void DisplayChangeObserver::OnAppTerminating() { 258 void DisplayChangeObserver::OnAppTerminating() {
259 #if defined(USE_ASH) 259 #if defined(USE_ASH)
260 // Stop handling display configuration events once the shutdown 260 // Stop handling display configuration events once the shutdown
261 // process starts. crbug.com/177014. 261 // process starts. crbug.com/177014.
262 Shell::GetInstance()->display_configurator()->PrepareForExit(); 262 Shell::GetInstance()->display_configurator()->PrepareForExit();
263 #endif 263 #endif
(...skipping 10 matching lines...) Expand all
274 274
275 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() { 275 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() {
276 OnDisplayModeChanged( 276 OnDisplayModeChanged(
277 Shell::GetInstance()->display_configurator()->cached_displays()); 277 Shell::GetInstance()->display_configurator()->cached_displays());
278 } 278 }
279 279
280 void DisplayChangeObserver::OnKeyboardDeviceConfigurationChanged() { 280 void DisplayChangeObserver::OnKeyboardDeviceConfigurationChanged() {
281 } 281 }
282 282
283 } // namespace ash 283 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698