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

Side by Side Diff: ui/display/chromeos/display_configurator.cc

Issue 230763004: Split ui/display types into separate module and have Ozone depend on it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/display/chromeos/display_configurator.h" 5 #include "ui/display/chromeos/display_configurator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/sys_info.h" 12 #include "base/sys_info.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "ui/display/chromeos/display_mode.h"
15 #include "ui/display/chromeos/display_snapshot.h"
16 #include "ui/display/chromeos/native_display_delegate.h"
17 #include "ui/display/display_switches.h" 14 #include "ui/display/display_switches.h"
15 #include "ui/display/types/chromeos/display_mode.h"
16 #include "ui/display/types/chromeos/display_snapshot.h"
17 #include "ui/display/types/chromeos/native_display_delegate.h"
18 18
19 #if defined(USE_OZONE) 19 #if defined(USE_OZONE)
20 #include "ui/display/chromeos/ozone/native_display_delegate_ozone.h"
21 #include "ui/display/chromeos/ozone/touchscreen_delegate_ozone.h" 20 #include "ui/display/chromeos/ozone/touchscreen_delegate_ozone.h"
21 #include "ui/ozone/ozone_platform.h"
22 #elif defined(USE_X11) 22 #elif defined(USE_X11)
23 #include "ui/display/chromeos/x11/native_display_delegate_x11.h" 23 #include "ui/display/chromeos/x11/native_display_delegate_x11.h"
24 #include "ui/display/chromeos/x11/touchscreen_delegate_x11.h" 24 #include "ui/display/chromeos/x11/touchscreen_delegate_x11.h"
25 #endif 25 #endif
26 26
27 namespace ui { 27 namespace ui {
28 28
29 namespace { 29 namespace {
30 30
31 typedef std::vector<const DisplayMode*> DisplayModeList; 31 typedef std::vector<const DisplayMode*> DisplayModeList;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 power_state_ = power_state; 194 power_state_ = power_state;
195 } 195 }
196 196
197 void DisplayConfigurator::Init(bool is_panel_fitting_enabled) { 197 void DisplayConfigurator::Init(bool is_panel_fitting_enabled) {
198 is_panel_fitting_enabled_ = is_panel_fitting_enabled; 198 is_panel_fitting_enabled_ = is_panel_fitting_enabled;
199 if (!configure_display_) 199 if (!configure_display_)
200 return; 200 return;
201 201
202 if (!native_display_delegate_) { 202 if (!native_display_delegate_) {
203 #if defined(USE_OZONE) 203 #if defined(USE_OZONE)
204 native_display_delegate_.reset(new NativeDisplayDelegateOzone()); 204 native_display_delegate_.reset(
205 OzonePlatform::GetInstance()->CreateNativeDisplayDelegate());
205 #elif defined(USE_X11) 206 #elif defined(USE_X11)
206 native_display_delegate_.reset(new NativeDisplayDelegateX11()); 207 native_display_delegate_.reset(new NativeDisplayDelegateX11());
207 #else 208 #else
208 NOTREACHED(); 209 NOTREACHED();
209 #endif 210 #endif
210 native_display_delegate_->AddObserver(this); 211 native_display_delegate_->AddObserver(this);
211 } 212 }
212 213
213 if (!touchscreen_delegate_) { 214 if (!touchscreen_delegate_) {
214 #if defined(USE_OZONE) 215 #if defined(USE_OZONE)
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 float width_ratio = static_cast<float>(mirror_mode_info->size().width()) / 1060 float width_ratio = static_cast<float>(mirror_mode_info->size().width()) /
1060 static_cast<float>(native_mode_info->size().width()); 1061 static_cast<float>(native_mode_info->size().width());
1061 float height_ratio = static_cast<float>(mirror_mode_info->size().height()) / 1062 float height_ratio = static_cast<float>(mirror_mode_info->size().height()) /
1062 static_cast<float>(native_mode_info->size().height()); 1063 static_cast<float>(native_mode_info->size().height());
1063 1064
1064 area_ratio = width_ratio * height_ratio; 1065 area_ratio = width_ratio * height_ratio;
1065 return area_ratio; 1066 return area_ratio;
1066 } 1067 }
1067 1068
1068 } // namespace ui 1069 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698