| 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/screen.h" | 5 #include "ui/gfx/screen.h" |
| 6 | 6 |
| 7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 return GetPrimaryDisplay(); | 150 return GetPrimaryDisplay(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 // Returns the primary display. | 153 // Returns the primary display. |
| 154 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { | 154 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { |
| 155 gfx::Rect bounds = NativePrimaryMonitorBounds(); | 155 gfx::Rect bounds = NativePrimaryMonitorBounds(); |
| 156 // TODO(oshima): Implement ID and Observer. | 156 // TODO(oshima): Implement ID and Observer. |
| 157 gfx::Display display(0, bounds); | 157 gfx::Display display(0, bounds); |
| 158 gfx::Rect rect; | 158 gfx::Rect rect; |
| 159 if (GetScreenWorkArea(&rect)) { | 159 if (GetScreenWorkArea(&rect)) { |
| 160 display.set_work_area(rect.Intersect(bounds)); | 160 bounds.Intersect(rect); |
| 161 display.set_work_area(bounds); |
| 161 } else { | 162 } else { |
| 162 // Return the best we've got. | 163 // Return the best we've got. |
| 163 display.set_work_area(bounds); | 164 display.set_work_area(bounds); |
| 164 } | 165 } |
| 165 return display; | 166 return display; |
| 166 } | 167 } |
| 167 | 168 |
| 168 private: | 169 private: |
| 169 DISALLOW_COPY_AND_ASSIGN(ScreenGtk); | 170 DISALLOW_COPY_AND_ASSIGN(ScreenGtk); |
| 170 }; | 171 }; |
| 171 | 172 |
| 172 } // namespace | 173 } // namespace |
| 173 | 174 |
| 174 namespace gfx { | 175 namespace gfx { |
| 175 | 176 |
| 176 Screen* CreateNativeScreen() { | 177 Screen* CreateNativeScreen() { |
| 177 return new ScreenGtk; | 178 return new ScreenGtk; |
| 178 } | 179 } |
| 179 | 180 |
| 180 } // namespace gfx | 181 } // namespace gfx |
| OLD | NEW |