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

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: Rebased. 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 27 matching lines...) Expand all
38 } else if (switch_value == switches::kTouchOptimizedUIDisabled) { 38 } else if (switch_value == switches::kTouchOptimizedUIDisabled) {
39 return false; 39 return false;
40 } else if (switch_value != switches::kTouchOptimizedUIAuto) { 40 } else if (switch_value != switches::kTouchOptimizedUIAuto) {
41 LOG(ERROR) << "Invalid --touch-optimized-ui option: " << switch_value; 41 LOG(ERROR) << "Invalid --touch-optimized-ui option: " << switch_value;
42 } 42 }
43 } 43 }
44 44
45 #if defined(OS_WIN) 45 #if defined(OS_WIN)
46 // On Windows, we use the touch layout only when we are running in 46 // On Windows, we use the touch layout only when we are running in
47 // Metro mode. 47 // Metro mode.
48 return base::win::GetMetroModule() != NULL; 48 return base::win::IsMetroProcess();
49 #elif defined(USE_AURA) && defined(USE_X11) 49 #elif defined(USE_AURA) && defined(USE_X11)
50 // Determine whether touch-screen hardware is currently available. 50 // Determine whether touch-screen hardware is currently available.
51 // For now we must ensure this won't change over the life of the process, 51 // For now we must ensure this won't change over the life of the process,
52 // since we don't yet support updating the UI. crbug.com/124399 52 // since we don't yet support updating the UI. crbug.com/124399
53 static bool has_touch_device = 53 static bool has_touch_device =
54 ui::TouchFactory::GetInstance()->IsTouchDevicePresent(); 54 ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
55 55
56 // Work-around for late device detection in some cases. If we've asked for 56 // Work-around for late device detection in some cases. If we've asked for
57 // touch calibration then we're certainly expecting a touch screen, it must 57 // touch calibration then we're certainly expecting a touch screen, it must
58 // just not be ready yet. Force-enable touch-ui mode in this case. 58 // just not be ready yet. Force-enable touch-ui mode in this case.
(...skipping 29 matching lines...) Expand all
88 #else 88 #else
89 return LAYOUT_DESKTOP; 89 return LAYOUT_DESKTOP;
90 #endif 90 #endif
91 } 91 }
92 92
93 float GetScaleFactorScale(ScaleFactor scale_factor) { 93 float GetScaleFactorScale(ScaleFactor scale_factor) {
94 return kScaleFactorScales[scale_factor]; 94 return kScaleFactorScales[scale_factor];
95 } 95 }
96 96
97 } // namespace ui 97 } // namespace ui
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.cc ('k') | ui/views/controls/textfield/native_textfield_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698