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

Side by Side Diff: base/win/metro.cc

Issue 10855072: Add IsTsfAwareRequired method (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add comments Created 8 years, 4 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
« no previous file with comments | « base/win/metro.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « base/win/metro.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698