| 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 bounds.Intersect(rect); | 160 display.set_work_area(gfx::Intersection(rect, bounds)); |
| 161 display.set_work_area(bounds); | |
| 162 } else { | 161 } else { |
| 163 // Return the best we've got. | 162 // Return the best we've got. |
| 164 display.set_work_area(bounds); | 163 display.set_work_area(bounds); |
| 165 } | 164 } |
| 166 return display; | 165 return display; |
| 167 } | 166 } |
| 168 | 167 |
| 169 private: | 168 private: |
| 170 DISALLOW_COPY_AND_ASSIGN(ScreenGtk); | 169 DISALLOW_COPY_AND_ASSIGN(ScreenGtk); |
| 171 }; | 170 }; |
| 172 | 171 |
| 173 } // namespace | 172 } // namespace |
| 174 | 173 |
| 175 namespace gfx { | 174 namespace gfx { |
| 176 | 175 |
| 177 Screen* CreateNativeScreen() { | 176 Screen* CreateNativeScreen() { |
| 178 return new ScreenGtk; | 177 return new ScreenGtk; |
| 179 } | 178 } |
| 180 | 179 |
| 181 } // namespace gfx | 180 } // namespace gfx |
| OLD | NEW |