Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: ui/base/layout.cc

Issue 10560015: Implement base::win::IsMetroProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/base/layout.h" 5 #include "ui/base/layout.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 26 matching lines...) Expand all
37 } else if (switch_value == switches::kTouchOptimizedUIDisabled) { 37 } else if (switch_value == switches::kTouchOptimizedUIDisabled) {
38 return false; 38 return false;
39 } else if (switch_value != switches::kTouchOptimizedUIAuto) { 39 } else if (switch_value != switches::kTouchOptimizedUIAuto) {
40 LOG(ERROR) << "Invalid --touch-optimized-ui option: " << switch_value; 40 LOG(ERROR) << "Invalid --touch-optimized-ui option: " << switch_value;
41 } 41 }
42 } 42 }
43 43
44 #if defined(OS_WIN) 44 #if defined(OS_WIN)
45 // On Windows, we use the touch layout only when we are running in 45 // On Windows, we use the touch layout only when we are running in
46 // Metro mode. 46 // Metro mode.
47 return base::win::GetMetroModule() != NULL; 47 return base::win::InMetroMode();
48 #elif defined(USE_AURA) && defined(USE_X11) 48 #elif defined(USE_AURA) && defined(USE_X11)
49 // Determine whether touch-screen hardware is currently available. 49 // Determine whether touch-screen hardware is currently available.
50 // For now we assume this won't change over the life of the process, but 50 // For now we assume this won't change over the life of the process, but
51 // we'll probably want to support that. crbug.com/124399 51 // we'll probably want to support that. crbug.com/124399
52 return ui::TouchFactory::GetInstance()->IsTouchDevicePresent(); 52 return ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
53 #else 53 #else
54 return false; 54 return false;
55 #endif 55 #endif
56 } 56 }
57 57
(...skipping 18 matching lines...) Expand all
76 #else 76 #else
77 return LAYOUT_DESKTOP; 77 return LAYOUT_DESKTOP;
78 #endif 78 #endif
79 } 79 }
80 80
81 float GetScaleFactorScale(ScaleFactor scale_factor) { 81 float GetScaleFactorScale(ScaleFactor scale_factor) {
82 return kScaleFactorScales[scale_factor]; 82 return kScaleFactorScales[scale_factor];
83 } 83 }
84 84
85 } // namespace ui 85 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698