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 "base/win/metro.h" | 5 #include "base/win/metro.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/win/scoped_comptr.h" | 9 #include "base/win/scoped_comptr.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // No "IsImmersiveProcess" export on user32.dll, so this is pre-Windows8 | 66 // No "IsImmersiveProcess" export on user32.dll, so this is pre-Windows8 |
67 // and therefore not immersive. | 67 // and therefore not immersive. |
68 state = kImmersiveFalse; | 68 state = kImmersiveFalse; |
69 } | 69 } |
70 } | 70 } |
71 DCHECK_NE(kImmersiveUnknown, state); | 71 DCHECK_NE(kImmersiveUnknown, state); |
72 | 72 |
73 return state == kImmersiveTrue; | 73 return state == kImmersiveTrue; |
74 } | 74 } |
75 | 75 |
| 76 bool IsTsfAwareRequired() { |
| 77 // Although this function is equal to IsMetroProcess at this moment, |
| 78 // Chrome for Win7 and Vista may support TSF in the future. |
| 79 return IsMetroProcess(); |
| 80 } |
| 81 |
76 wchar_t* LocalAllocAndCopyString(const string16& src) { | 82 wchar_t* LocalAllocAndCopyString(const string16& src) { |
77 size_t dest_size = (src.length() + 1) * sizeof(wchar_t); | 83 size_t dest_size = (src.length() + 1) * sizeof(wchar_t); |
78 wchar_t* dest = reinterpret_cast<wchar_t*>(LocalAlloc(LPTR, dest_size)); | 84 wchar_t* dest = reinterpret_cast<wchar_t*>(LocalAlloc(LPTR, dest_size)); |
79 base::wcslcpy(dest, src.c_str(), dest_size); | 85 base::wcslcpy(dest, src.c_str(), dest_size); |
80 return dest; | 86 return dest; |
81 } | 87 } |
82 | 88 |
83 bool IsTouchEnabled() { | 89 bool IsTouchEnabled() { |
84 int value = GetSystemMetrics(SM_DIGITIZER); | 90 int value = GetSystemMetrics(SM_DIGITIZER); |
85 return value & (NID_READY | NID_INTEGRATED_TOUCH) == | 91 return value & (NID_READY | NID_INTEGRATED_TOUCH) == |
(...skipping 27 matching lines...) Expand all Loading... |
113 unsigned long restrictions = 0; | 119 unsigned long restrictions = 0; |
114 settings->GetRestrictions(&restrictions); | 120 settings->GetRestrictions(&restrictions); |
115 | 121 |
116 parental_control_logging_required = | 122 parental_control_logging_required = |
117 (restrictions & WPCFLAG_LOGGING_REQUIRED) == WPCFLAG_LOGGING_REQUIRED; | 123 (restrictions & WPCFLAG_LOGGING_REQUIRED) == WPCFLAG_LOGGING_REQUIRED; |
118 return parental_control_logging_required; | 124 return parental_control_logging_required; |
119 } | 125 } |
120 | 126 |
121 } // namespace win | 127 } // namespace win |
122 } // namespace base | 128 } // namespace base |
OLD | NEW |