| 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/win_util.h" | 5 #include "base/win/win_util.h" |
| 6 | 6 |
| 7 #include <aclapi.h> | 7 #include <aclapi.h> |
| 8 #include <cfgmgr32.h> | 8 #include <cfgmgr32.h> |
| 9 #include <lm.h> | 9 #include <lm.h> |
| 10 #include <powrprof.h> | 10 #include <powrprof.h> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "base/base_switches.h" | 23 #include "base/base_switches.h" |
| 24 #include "base/command_line.h" | 24 #include "base/command_line.h" |
| 25 #include "base/lazy_instance.h" | 25 #include "base/lazy_instance.h" |
| 26 #include "base/logging.h" | 26 #include "base/logging.h" |
| 27 #include "base/macros.h" | 27 #include "base/macros.h" |
| 28 #include "base/memory/scoped_ptr.h" | 28 #include "base/memory/scoped_ptr.h" |
| 29 #include "base/strings/string_util.h" | 29 #include "base/strings/string_util.h" |
| 30 #include "base/strings/stringprintf.h" | 30 #include "base/strings/stringprintf.h" |
| 31 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
| 32 #include "base/threading/thread_restrictions.h" | 32 #include "base/threading/thread_restrictions.h" |
| 33 #include "base/win/metro.h" | |
| 34 #include "base/win/registry.h" | 33 #include "base/win/registry.h" |
| 35 #include "base/win/scoped_co_mem.h" | 34 #include "base/win/scoped_co_mem.h" |
| 36 #include "base/win/scoped_handle.h" | 35 #include "base/win/scoped_handle.h" |
| 37 #include "base/win/scoped_propvariant.h" | 36 #include "base/win/scoped_propvariant.h" |
| 38 #include "base/win/windows_version.h" | 37 #include "base/win/windows_version.h" |
| 39 | 38 |
| 40 namespace base { | 39 namespace base { |
| 41 namespace win { | 40 namespace win { |
| 42 | 41 |
| 43 namespace { | 42 namespace { |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 // programmatically. | 524 // programmatically. |
| 526 const wchar_t kOSKClassName[] = L"IPTip_Main_Window"; | 525 const wchar_t kOSKClassName[] = L"IPTip_Main_Window"; |
| 527 HWND osk = ::FindWindow(kOSKClassName, NULL); | 526 HWND osk = ::FindWindow(kOSKClassName, NULL); |
| 528 if (::IsWindow(osk) && ::IsWindowEnabled(osk)) { | 527 if (::IsWindow(osk) && ::IsWindowEnabled(osk)) { |
| 529 PostMessage(osk, WM_SYSCOMMAND, SC_CLOSE, 0); | 528 PostMessage(osk, WM_SYSCOMMAND, SC_CLOSE, 0); |
| 530 return true; | 529 return true; |
| 531 } | 530 } |
| 532 return false; | 531 return false; |
| 533 } | 532 } |
| 534 | 533 |
| 535 typedef HWND (*MetroRootWindow) (); | |
| 536 | |
| 537 enum DomainEnrollementState {UNKNOWN = -1, NOT_ENROLLED, ENROLLED}; | 534 enum DomainEnrollementState {UNKNOWN = -1, NOT_ENROLLED, ENROLLED}; |
| 538 static volatile long int g_domain_state = UNKNOWN; | 535 static volatile long int g_domain_state = UNKNOWN; |
| 539 | 536 |
| 540 bool IsEnrolledToDomain() { | 537 bool IsEnrolledToDomain() { |
| 541 // Doesn't make any sense to retry inside a user session because joining a | 538 // Doesn't make any sense to retry inside a user session because joining a |
| 542 // domain will only kick in on a restart. | 539 // domain will only kick in on a restart. |
| 543 if (g_domain_state == UNKNOWN) { | 540 if (g_domain_state == UNKNOWN) { |
| 544 LPWSTR domain; | 541 LPWSTR domain; |
| 545 NETSETUP_JOIN_STATUS join_status; | 542 NETSETUP_JOIN_STATUS join_status; |
| 546 if(::NetGetJoinInformation(NULL, &domain, &join_status) != NERR_Success) | 543 if(::NetGetJoinInformation(NULL, &domain, &join_status) != NERR_Success) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 } | 576 } |
| 580 | 577 |
| 581 bool IsUser32AndGdi32Available() { | 578 bool IsUser32AndGdi32Available() { |
| 582 static base::LazyInstance<LazyIsUser32AndGdi32Available>::Leaky available = | 579 static base::LazyInstance<LazyIsUser32AndGdi32Available>::Leaky available = |
| 583 LAZY_INSTANCE_INITIALIZER; | 580 LAZY_INSTANCE_INITIALIZER; |
| 584 return available.Get().value(); | 581 return available.Get().value(); |
| 585 } | 582 } |
| 586 | 583 |
| 587 } // namespace win | 584 } // namespace win |
| 588 } // namespace base | 585 } // namespace base |
| OLD | NEW |