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

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

Issue 2523873002: Remove DisplayChangeObserver ash dependencies. (Closed)
Patch Set: Change DCO constructor slightly. Created 4 years 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 | « ash/ash_strings.grd ('k') | ash/display/display_change_observer_chromeos.cc » ('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 #ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H_ 5 #ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H_
6 #define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H_ 6 #define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
10 #include <vector> 11 #include <vector>
11 12
12 #include "ash/ash_export.h" 13 #include "ash/ash_export.h"
13 #include "ash/common/shell_observer.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "ui/display/manager/chromeos/display_configurator.h" 15 #include "ui/display/manager/chromeos/display_configurator.h"
16 #include "ui/display/manager/managed_display_info.h" 16 #include "ui/display/manager/managed_display_info.h"
17 #include "ui/events/devices/input_device_event_observer.h" 17 #include "ui/events/devices/input_device_event_observer.h"
18 18
19 namespace display {
20 class DisplayManager;
21 }
22
19 namespace ash { 23 namespace ash {
20 24
21 class DisplaySnapshot; 25 class DisplaySnapshot;
22 26
23 // An object that observes changes in display configuration and 27 // An object that observes changes in display configuration and updates
24 // update DisplayManagers. 28 // DisplayManager.
25 class DisplayChangeObserver : public ui::DisplayConfigurator::StateController, 29 class DisplayChangeObserver : public ui::DisplayConfigurator::StateController,
26 public ui::DisplayConfigurator::Observer, 30 public ui::DisplayConfigurator::Observer,
27 public ui::InputDeviceEventObserver, 31 public ui::InputDeviceEventObserver {
28 public ShellObserver {
29 public: 32 public:
30 // Returns the mode list for internal display. 33 // Returns the mode list for internal display.
31 ASH_EXPORT static display::ManagedDisplayInfo::ManagedDisplayModeList 34 ASH_EXPORT static display::ManagedDisplayInfo::ManagedDisplayModeList
32 GetInternalManagedDisplayModeList( 35 GetInternalManagedDisplayModeList(
33 const display::ManagedDisplayInfo& display_info, 36 const display::ManagedDisplayInfo& display_info,
34 const ui::DisplaySnapshot& output); 37 const ui::DisplaySnapshot& output);
35 38
36 // Returns the resolution list. 39 // Returns the resolution list.
37 ASH_EXPORT static display::ManagedDisplayInfo::ManagedDisplayModeList 40 ASH_EXPORT static display::ManagedDisplayInfo::ManagedDisplayModeList
38 GetExternalManagedDisplayModeList(const ui::DisplaySnapshot& output); 41 GetExternalManagedDisplayModeList(const ui::DisplaySnapshot& output);
39 42
40 DisplayChangeObserver(); 43 DisplayChangeObserver(ui::DisplayConfigurator* display_configurator,
44 display::DisplayManager* display_manager);
41 ~DisplayChangeObserver() override; 45 ~DisplayChangeObserver() override;
42 46
43 // ui::DisplayConfigurator::StateController overrides: 47 // ui::DisplayConfigurator::StateController overrides:
44 ui::MultipleDisplayState GetStateForDisplayIds( 48 ui::MultipleDisplayState GetStateForDisplayIds(
45 const ui::DisplayConfigurator::DisplayStateList& outputs) const override; 49 const ui::DisplayConfigurator::DisplayStateList& outputs) const override;
46 bool GetResolutionForDisplayId(int64_t display_id, 50 bool GetResolutionForDisplayId(int64_t display_id,
47 gfx::Size* size) const override; 51 gfx::Size* size) const override;
48 52
49 // Overriden from ui::DisplayConfigurator::Observer: 53 // Overriden from ui::DisplayConfigurator::Observer:
50 void OnDisplayModeChanged( 54 void OnDisplayModeChanged(
51 const ui::DisplayConfigurator::DisplayStateList& outputs) override; 55 const ui::DisplayConfigurator::DisplayStateList& outputs) override;
52 void OnDisplayModeChangeFailed( 56 void OnDisplayModeChangeFailed(
53 const ui::DisplayConfigurator::DisplayStateList& displays, 57 const ui::DisplayConfigurator::DisplayStateList& displays,
54 ui::MultipleDisplayState failed_new_state) override; 58 ui::MultipleDisplayState failed_new_state) override;
55 59
56 // Overriden from ui::InputDeviceEventObserver: 60 // Overriden from ui::InputDeviceEventObserver:
57 void OnTouchscreenDeviceConfigurationChanged() override; 61 void OnTouchscreenDeviceConfigurationChanged() override;
58 62
59 // Overriden from ShellObserver:
60 void OnAppTerminating() override;
61
62 // Exposed for testing. 63 // Exposed for testing.
63 ASH_EXPORT static float FindDeviceScaleFactor(float dpi); 64 ASH_EXPORT static float FindDeviceScaleFactor(float dpi);
64 65
65 private: 66 private:
67 // Both |display_configurator_| and |display_manager_| are not owned and must
68 // outlive DisplayChangeObserver.
69 ui::DisplayConfigurator* display_configurator_;
70 display::DisplayManager* display_manager_;
71
66 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver); 72 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver);
67 }; 73 };
68 74
69 } // namespace ash 75 } // namespace ash
70 76
71 #endif // ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H_ 77 #endif // ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H_
OLDNEW
« no previous file with comments | « ash/ash_strings.grd ('k') | ash/display/display_change_observer_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698