| OLD | NEW |
| 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 "ui/gfx/display.h" | 5 #include "ui/gfx/display.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 //static | 52 //static |
| 53 bool Display::HasForceDeviceScaleFactor() { | 53 bool Display::HasForceDeviceScaleFactor() { |
| 54 return HasForceDeviceScaleFactorImpl(); | 54 return HasForceDeviceScaleFactorImpl(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 Display::Display() | 57 Display::Display() |
| 58 : id_(kInvalidDisplayID), | 58 : id_(kInvalidDisplayID), |
| 59 device_scale_factor_(GetForcedDeviceScaleFactor()), | 59 device_scale_factor_(GetForcedDeviceScaleFactor()), |
| 60 rotation_(ROTATE_0) { | 60 rotation_(ROTATE_0), |
| 61 touch_support_(TOUCH_SUPPORT_UNKNOWN) { |
| 61 } | 62 } |
| 62 | 63 |
| 63 Display::Display(int64 id) | 64 Display::Display(int64 id) |
| 64 : id_(id), | 65 : id_(id), |
| 65 device_scale_factor_(GetForcedDeviceScaleFactor()), | 66 device_scale_factor_(GetForcedDeviceScaleFactor()), |
| 66 rotation_(ROTATE_0) { | 67 rotation_(ROTATE_0), |
| 68 touch_support_(TOUCH_SUPPORT_UNKNOWN) { |
| 67 } | 69 } |
| 68 | 70 |
| 69 Display::Display(int64 id, const gfx::Rect& bounds) | 71 Display::Display(int64 id, const gfx::Rect& bounds) |
| 70 : id_(id), | 72 : id_(id), |
| 71 bounds_(bounds), | 73 bounds_(bounds), |
| 72 work_area_(bounds), | 74 work_area_(bounds), |
| 73 device_scale_factor_(GetForcedDeviceScaleFactor()), | 75 device_scale_factor_(GetForcedDeviceScaleFactor()), |
| 74 rotation_(ROTATE_0) { | 76 rotation_(ROTATE_0), |
| 77 touch_support_(TOUCH_SUPPORT_UNKNOWN) { |
| 75 #if defined(USE_AURA) | 78 #if defined(USE_AURA) |
| 76 SetScaleAndBounds(device_scale_factor_, bounds); | 79 SetScaleAndBounds(device_scale_factor_, bounds); |
| 77 #endif | 80 #endif |
| 78 } | 81 } |
| 79 | 82 |
| 80 Display::~Display() { | 83 Display::~Display() { |
| 81 } | 84 } |
| 82 | 85 |
| 83 Insets Display::GetWorkAreaInsets() const { | 86 Insets Display::GetWorkAreaInsets() const { |
| 84 return gfx::Insets(work_area_.y() - bounds_.y(), | 87 return gfx::Insets(work_area_.y() - bounds_.y(), |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 146 |
| 144 int64 Display::InternalDisplayId() { | 147 int64 Display::InternalDisplayId() { |
| 145 return internal_display_id_; | 148 return internal_display_id_; |
| 146 } | 149 } |
| 147 | 150 |
| 148 void Display::SetInternalDisplayId(int64 internal_display_id) { | 151 void Display::SetInternalDisplayId(int64 internal_display_id) { |
| 149 internal_display_id_ = internal_display_id; | 152 internal_display_id_ = internal_display_id; |
| 150 } | 153 } |
| 151 | 154 |
| 152 } // namespace gfx | 155 } // namespace gfx |
| OLD | NEW |