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

Side by Side Diff: base/win_util.cc

Issue 3257011: Registered the service process to AutoRun (for Windows) if any service (Cloud... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixed Linux compile Created 10 years, 3 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
« no previous file with comments | « base/win_util.h ('k') | chrome/browser/service/service_process_control.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_util.h" 5 #include "base/win_util.h"
6 6
7 #include <aclapi.h> 7 #include <aclapi.h>
8 #include <propvarutil.h> 8 #include <propvarutil.h>
9 #include <sddl.h> 9 #include <sddl.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 HRESULT result = property_store->SetValue(kPKEYAppUserModelID, 409 HRESULT result = property_store->SetValue(kPKEYAppUserModelID,
410 property_value); 410 property_value);
411 if (S_OK == result) 411 if (S_OK == result)
412 result = property_store->Commit(); 412 result = property_store->Commit();
413 413
414 PropVariantClear(&property_value); 414 PropVariantClear(&property_value);
415 return SUCCEEDED(result); 415 return SUCCEEDED(result);
416 } 416 }
417 417
418 static const char16 kAutoRunKeyPath[] =
419 L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
420
421 bool AddCommandToAutoRun(HKEY root_key, const string16& name,
422 const string16& command) {
423 RegKey autorun_key(root_key, kAutoRunKeyPath, KEY_SET_VALUE);
424 return autorun_key.WriteValue(name.c_str(), command.c_str());
425 }
426
427 bool RemoveCommandFromAutoRun(HKEY root_key, const string16& name) {
428 RegKey autorun_key(root_key, kAutoRunKeyPath, KEY_SET_VALUE);
429 return autorun_key.DeleteValue(name.c_str());
430 }
431
418 } // namespace win_util 432 } // namespace win_util
419 433
420 #ifdef _MSC_VER 434 #ifdef _MSC_VER
421 // 435 //
422 // If the ASSERT below fails, please install Visual Studio 2005 Service Pack 1. 436 // If the ASSERT below fails, please install Visual Studio 2005 Service Pack 1.
423 // 437 //
424 extern char VisualStudio2005ServicePack1Detection[10]; 438 extern char VisualStudio2005ServicePack1Detection[10];
425 COMPILE_ASSERT(sizeof(&VisualStudio2005ServicePack1Detection) == sizeof(void*), 439 COMPILE_ASSERT(sizeof(&VisualStudio2005ServicePack1Detection) == sizeof(void*),
426 VS2005SP1Detect); 440 VS2005SP1Detect);
427 // 441 //
428 // Chrome requires at least Service Pack 1 for Visual Studio 2005. 442 // Chrome requires at least Service Pack 1 for Visual Studio 2005.
429 // 443 //
430 #endif // _MSC_VER 444 #endif // _MSC_VER
431 445
432 #ifndef COPY_FILE_COPY_SYMLINK 446 #ifndef COPY_FILE_COPY_SYMLINK
433 #error You must install the Windows 2008 or Vista Software Development Kit and \ 447 #error You must install the Windows 2008 or Vista Software Development Kit and \
434 set it as your default include path to build this library. You can grab it by \ 448 set it as your default include path to build this library. You can grab it by \
435 searching for "download windows sdk 2008" in your favorite web search engine. \ 449 searching for "download windows sdk 2008" in your favorite web search engine. \
436 Also make sure you register the SDK with Visual Studio, by selecting \ 450 Also make sure you register the SDK with Visual Studio, by selecting \
437 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \ 451 "Integrate Windows SDK with Visual Studio 2005" from the Windows SDK \
438 menu (see Start - All Programs - Microsoft Windows SDK - \ 452 menu (see Start - All Programs - Microsoft Windows SDK - \
439 Visual Studio Registration). 453 Visual Studio Registration).
440 #endif 454 #endif
OLDNEW
« no previous file with comments | « base/win_util.h ('k') | chrome/browser/service/service_process_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698