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

Side by Side Diff: chrome/browser/policy/policy_loader_win.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 "chrome/browser/policy/policy_loader_win.h" 5 #include "chrome/browser/policy/policy_loader_win.h"
6 6
7 #include <rpc.h> // For struct GUID 7 #include <rpc.h> // For struct GUID
8 #include <shlwapi.h> // For PathIsUNC() 8 #include <shlwapi.h> // For PathIsUNC()
9 #include <userenv.h> // For GPO functions 9 #include <userenv.h> // For GPO functions
10 #include <windows.h> 10 #include <windows.h>
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 576
577 bool PolicyLoaderWin::ReadPRegFile(const base::FilePath& preg_file, 577 bool PolicyLoaderWin::ReadPRegFile(const base::FilePath& preg_file,
578 base::DictionaryValue* policy, 578 base::DictionaryValue* policy,
579 PolicyLoadStatusSample* status) { 579 PolicyLoadStatusSample* status) {
580 // The following deals with the minor annoyance that Wow64 FS redirection 580 // The following deals with the minor annoyance that Wow64 FS redirection
581 // might need to be turned off: This is the case if running as a 32-bit 581 // might need to be turned off: This is the case if running as a 32-bit
582 // process on a 64-bit system, in which case Wow64 FS redirection redirects 582 // process on a 64-bit system, in which case Wow64 FS redirection redirects
583 // access to the %WINDIR%/System32/GroupPolicy directory to 583 // access to the %WINDIR%/System32/GroupPolicy directory to
584 // %WINDIR%/SysWOW64/GroupPolicy, but the file is actually in the 584 // %WINDIR%/SysWOW64/GroupPolicy, but the file is actually in the
585 // system-native directory. 585 // system-native directory.
586 if (file_util::PathExists(preg_file)) { 586 if (base::PathExists(preg_file)) {
587 return preg_parser::ReadFile(preg_file, chrome_policy_key_, policy, status); 587 return preg_parser::ReadFile(preg_file, chrome_policy_key_, policy, status);
588 } else { 588 } else {
589 // Try with redirection switched off. 589 // Try with redirection switched off.
590 ScopedDisableWow64Redirection redirection_disable; 590 ScopedDisableWow64Redirection redirection_disable;
591 if (redirection_disable.is_active() && file_util::PathExists(preg_file)) { 591 if (redirection_disable.is_active() && base::PathExists(preg_file)) {
592 status->Add(POLICY_LOAD_STATUS_WOW64_REDIRECTION_DISABLED); 592 status->Add(POLICY_LOAD_STATUS_WOW64_REDIRECTION_DISABLED);
593 return preg_parser::ReadFile(preg_file, chrome_policy_key_, policy, 593 return preg_parser::ReadFile(preg_file, chrome_policy_key_, policy,
594 status); 594 status);
595 } 595 }
596 } 596 }
597 597
598 // Report the error. 598 // Report the error.
599 LOG(ERROR) << "PReg file doesn't exist: " << preg_file.value(); 599 LOG(ERROR) << "PReg file doesn't exist: " << preg_file.value();
600 status->Add(POLICY_LOAD_STATUS_MISSING); 600 status->Add(POLICY_LOAD_STATUS_MISSING);
601 return false; 601 return false;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 771
772 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) { 772 void PolicyLoaderWin::OnObjectSignaled(HANDLE object) {
773 DCHECK(object == user_policy_changed_event_.handle() || 773 DCHECK(object == user_policy_changed_event_.handle() ||
774 object == machine_policy_changed_event_.handle()) 774 object == machine_policy_changed_event_.handle())
775 << "unexpected object signaled policy reload, obj = " 775 << "unexpected object signaled policy reload, obj = "
776 << std::showbase << std::hex << object; 776 << std::showbase << std::hex << object;
777 Reload(false); 777 Reload(false);
778 } 778 }
779 779
780 } // namespace policy 780 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/prefs/chrome_pref_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698