OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/base/layout.h" |
| 6 |
| 7 #include "base/basictypes.h" |
| 8 #include "build/build_config.h" |
| 9 |
| 10 #if defined(OS_WIN) |
| 11 #include "base/win/metro.h" |
| 12 #include <Windows.h> |
| 13 #endif // defined(OS_WIN) |
| 14 |
| 15 namespace ui { |
| 16 |
| 17 // Note that this function should be extended to select |
| 18 // LAYOUT_TOUCH when appropriate on more platforms than just |
| 19 // Windows. |
| 20 DisplayLayout GetDisplayLayout() { |
| 21 #if defined(USE_ASH) |
| 22 return LAYOUT_ASH; |
| 23 #elif !defined(OS_WIN) |
| 24 return LAYOUT_DESKTOP; |
| 25 #else // On Windows. |
| 26 bool use_touch = false; |
| 27 #if defined(ENABLE_METRO) |
| 28 use_touch = base::win::GetMetroModule() != NULL; |
| 29 #endif // defined(ENABLE_METRO) |
| 30 if (use_touch) { |
| 31 return LAYOUT_TOUCH; |
| 32 } else { |
| 33 return LAYOUT_DESKTOP; |
| 34 } |
| 35 #endif // On Windows. |
| 36 } |
| 37 |
| 38 } // namespace ui |
OLD | NEW |