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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 break; | 108 break; |
109 case 90: | 109 case 90: |
110 rotation_ = ROTATE_90; | 110 rotation_ = ROTATE_90; |
111 break; | 111 break; |
112 case 180: | 112 case 180: |
113 rotation_ = ROTATE_180; | 113 rotation_ = ROTATE_180; |
114 break; | 114 break; |
115 case 270: | 115 case 270: |
116 rotation_ = ROTATE_270; | 116 rotation_ = ROTATE_270; |
117 break; | 117 break; |
| 118 default: |
| 119 // We should not reach that but we will just ignore the call if we do. |
| 120 NOTREACHED(); |
118 } | 121 } |
119 | |
120 // We should not reach that but we will just ignore the call if we do. | |
121 NOTREACHED(); | |
122 } | 122 } |
123 | 123 |
124 Insets Display::GetWorkAreaInsets() const { | 124 Insets Display::GetWorkAreaInsets() const { |
125 return gfx::Insets(work_area_.y() - bounds_.y(), | 125 return gfx::Insets(work_area_.y() - bounds_.y(), |
126 work_area_.x() - bounds_.x(), | 126 work_area_.x() - bounds_.x(), |
127 bounds_.bottom() - work_area_.bottom(), | 127 bounds_.bottom() - work_area_.bottom(), |
128 bounds_.right() - work_area_.right()); | 128 bounds_.right() - work_area_.right()); |
129 } | 129 } |
130 | 130 |
131 void Display::SetScaleAndBounds( | 131 void Display::SetScaleAndBounds( |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 int64 Display::InternalDisplayId() { | 185 int64 Display::InternalDisplayId() { |
186 return internal_display_id_; | 186 return internal_display_id_; |
187 } | 187 } |
188 | 188 |
189 void Display::SetInternalDisplayId(int64 internal_display_id) { | 189 void Display::SetInternalDisplayId(int64 internal_display_id) { |
190 internal_display_id_ = internal_display_id; | 190 internal_display_id_ = internal_display_id; |
191 } | 191 } |
192 | 192 |
193 } // namespace gfx | 193 } // namespace gfx |
OLD | NEW |