| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/metrics/display_utils.h" | |
| 6 | |
| 7 #include <gdk/gdk.h> | |
| 8 | |
| 9 #include "content/browser/browser_thread.h" | |
| 10 | |
| 11 // static | |
| 12 void DisplayUtils::GetPrimaryDisplayDimensions(int* width, int* height) { | |
| 13 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 14 GdkScreen* screen = gdk_screen_get_default(); | |
| 15 if (width) | |
| 16 *width = gdk_screen_get_width(screen); | |
| 17 if (height) | |
| 18 *height = gdk_screen_get_height(screen); | |
| 19 } | |
| 20 | |
| 21 // static | |
| 22 int DisplayUtils::GetDisplayCount() { | |
| 23 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 24 // This query is kinda bogus for Linux -- do we want number of X screens? | |
| 25 // The number of monitors Xinerama has? We'll just use whatever GDK uses. | |
| 26 GdkScreen* screen = gdk_screen_get_default(); | |
| 27 return gdk_screen_get_n_monitors(screen); | |
| 28 } | |
| OLD | NEW |