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

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

Issue 18413002: [Cleanup] Factor out layout store code from DisplayController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ash/ash.gyp ('k') | ash/display/display_controller.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 (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 "ash/display/display_change_observer_x11.h" 5 #include "ash/display/display_change_observer_x11.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
11 11
12 #include <X11/extensions/Xrandr.h> 12 #include <X11/extensions/Xrandr.h>
13 13
14 #include "ash/ash_switches.h" 14 #include "ash/ash_switches.h"
15 #include "ash/display/display_controller.h"
16 #include "ash/display/display_info.h" 15 #include "ash/display/display_info.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/shell.h" 18 #include "ash/shell.h"
19 #include "base/command_line.h" 19 #include "base/command_line.h"
20 #include "base/message_loop/message_pump_aurax11.h" 20 #include "base/message_loop/message_pump_aurax11.h"
21 #include "chromeos/display/output_util.h" 21 #include "chromeos/display/output_util.h"
22 #include "grit/ash_strings.h" 22 #include "grit/ash_strings.h"
23 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
24 #include "ui/compositor/dip_util.h" 24 #include "ui/compositor/dip_util.h"
25 #include "ui/gfx/display.h" 25 #include "ui/gfx/display.h"
26 26
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 chromeos::OutputState DisplayChangeObserverX11::GetStateForDisplayIds( 124 chromeos::OutputState DisplayChangeObserverX11::GetStateForDisplayIds(
125 const std::vector<int64>& display_ids) const { 125 const std::vector<int64>& display_ids) const {
126 if (CommandLine::ForCurrentProcess()->HasSwitch( 126 if (CommandLine::ForCurrentProcess()->HasSwitch(
127 switches::kAshForceMirrorMode)) { 127 switches::kAshForceMirrorMode)) {
128 return chromeos::STATE_DUAL_MIRROR; 128 return chromeos::STATE_DUAL_MIRROR;
129 } 129 }
130 130
131 CHECK_EQ(2U, display_ids.size()); 131 CHECK_EQ(2U, display_ids.size());
132 DisplayIdPair pair = std::make_pair(display_ids[0], display_ids[1]); 132 DisplayIdPair pair = std::make_pair(display_ids[0], display_ids[1]);
133 DisplayLayout layout = Shell::GetInstance()->display_controller()-> 133 DisplayLayout layout = Shell::GetInstance()->display_manager()->
134 GetRegisteredDisplayLayout(pair); 134 layout_store()->GetRegisteredDisplayLayout(pair);
135 return layout.mirrored ? 135 return layout.mirrored ?
136 chromeos::STATE_DUAL_MIRROR : chromeos::STATE_DUAL_EXTENDED; 136 chromeos::STATE_DUAL_MIRROR : chromeos::STATE_DUAL_EXTENDED;
137 } 137 }
138 138
139 void DisplayChangeObserverX11::OnDisplayModeChanged() { 139 void DisplayChangeObserverX11::OnDisplayModeChanged() {
140 XRRScreenResources* screen_resources = 140 XRRScreenResources* screen_resources =
141 XRRGetScreenResources(xdisplay_, x_root_window_); 141 XRRGetScreenResources(xdisplay_, x_root_window_);
142 std::map<XID, XRRCrtcInfo*> crtc_info_map; 142 std::map<XID, XRRCrtcInfo*> crtc_info_map;
143 143
144 for (int c = 0; c < screen_resources->ncrtc; c++) { 144 for (int c = 0; c < screen_resources->ncrtc; c++) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 void DisplayChangeObserverX11::OnAppTerminating() { 221 void DisplayChangeObserverX11::OnAppTerminating() {
222 #if defined(USE_ASH) 222 #if defined(USE_ASH)
223 // Stop handling display configuration events once the shutdown 223 // Stop handling display configuration events once the shutdown
224 // process starts. crbug.com/177014. 224 // process starts. crbug.com/177014.
225 Shell::GetInstance()->output_configurator()->Stop(); 225 Shell::GetInstance()->output_configurator()->Stop();
226 #endif 226 #endif
227 } 227 }
228 228
229 } // namespace internal 229 } // namespace internal
230 } // namespace ash 230 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/display/display_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698