| OLD | NEW |
| 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 <vector> | 10 #include <vector> |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 gfx::Display::InternalDisplayId() == gfx::Display::kInvalidDisplayID) { | 185 gfx::Display::InternalDisplayId() == gfx::Display::kInvalidDisplayID) { |
| 186 gfx::Display::SetInternalDisplayId(state.display->display_id()); | 186 gfx::Display::SetInternalDisplayId(state.display->display_id()); |
| 187 } | 187 } |
| 188 | 188 |
| 189 const ui::DisplayMode* mode_info = state.display->current_mode(); | 189 const ui::DisplayMode* mode_info = state.display->current_mode(); |
| 190 if (!mode_info) | 190 if (!mode_info) |
| 191 continue; | 191 continue; |
| 192 | 192 |
| 193 float device_scale_factor = 1.0f; | 193 float device_scale_factor = 1.0f; |
| 194 if (state.display->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL) { | 194 if (state.display->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL) { |
| 195 device_scale_factor = | 195 if (!ui::IsDisplaySizeBlackListed(state.display->physical_size())) { |
| 196 FindDeviceScaleFactor((kInchInMm * mode_info->size().width() / | 196 device_scale_factor = |
| 197 state.display->physical_size().width())); | 197 FindDeviceScaleFactor((kInchInMm * mode_info->size().width() / |
| 198 state.display->physical_size().width())); |
| 199 } |
| 198 } else { | 200 } else { |
| 199 DisplayMode mode; | 201 DisplayMode mode; |
| 200 if (Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId( | 202 if (Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId( |
| 201 state.display->display_id(), &mode)) { | 203 state.display->display_id(), &mode)) { |
| 202 device_scale_factor = mode.device_scale_factor; | 204 device_scale_factor = mode.device_scale_factor; |
| 203 } | 205 } |
| 204 } | 206 } |
| 205 gfx::Rect display_bounds(state.display->origin(), mode_info->size()); | 207 gfx::Rect display_bounds(state.display->origin(), mode_info->size()); |
| 206 | 208 |
| 207 std::string name = | 209 std::string name = |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // static | 256 // static |
| 255 float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) { | 257 float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) { |
| 256 for (size_t i = 0; i < arraysize(kThresholdTable); ++i) { | 258 for (size_t i = 0; i < arraysize(kThresholdTable); ++i) { |
| 257 if (dpi > kThresholdTable[i].dpi) | 259 if (dpi > kThresholdTable[i].dpi) |
| 258 return kThresholdTable[i].device_scale_factor; | 260 return kThresholdTable[i].device_scale_factor; |
| 259 } | 261 } |
| 260 return 1.0f; | 262 return 1.0f; |
| 261 } | 263 } |
| 262 | 264 |
| 263 } // namespace ash | 265 } // namespace ash |
| OLD | NEW |