OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/service_process_util.h" | 5 #include "chrome/common/service_process_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 bool ServiceProcessState::AddToAutoRun() { | 147 bool ServiceProcessState::AddToAutoRun() { |
148 DCHECK(autorun_command_line_.get()); | 148 DCHECK(autorun_command_line_.get()); |
149 // Remove the old autorun value first because we changed the naming scheme | 149 // Remove the old autorun value first because we changed the naming scheme |
150 // for the autorun value name. | 150 // for the autorun value name. |
151 base::win::RemoveCommandFromAutoRun( | 151 base::win::RemoveCommandFromAutoRun( |
152 HKEY_CURRENT_USER, UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); | 152 HKEY_CURRENT_USER, UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); |
153 return base::win::AddCommandToAutoRun( | 153 return base::win::AddCommandToAutoRun( |
154 HKEY_CURRENT_USER, | 154 HKEY_CURRENT_USER, |
155 UTF8ToWide(GetServiceProcessAutoRunKey()), | 155 UTF8ToWide(GetServiceProcessAutoRunKey()), |
156 autorun_command_line_->command_line_string()); | 156 autorun_command_line_->GetCommandLineString()); |
157 } | 157 } |
158 | 158 |
159 bool ServiceProcessState::RemoveFromAutoRun() { | 159 bool ServiceProcessState::RemoveFromAutoRun() { |
160 // Remove the old autorun value first because we changed the naming scheme | 160 // Remove the old autorun value first because we changed the naming scheme |
161 // for the autorun value name. | 161 // for the autorun value name. |
162 base::win::RemoveCommandFromAutoRun( | 162 base::win::RemoveCommandFromAutoRun( |
163 HKEY_CURRENT_USER, UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); | 163 HKEY_CURRENT_USER, UTF8ToWide(GetObsoleteServiceProcessAutoRunKey())); |
164 return base::win::RemoveCommandFromAutoRun( | 164 return base::win::RemoveCommandFromAutoRun( |
165 HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessAutoRunKey())); | 165 HKEY_CURRENT_USER, UTF8ToWide(GetServiceProcessAutoRunKey())); |
166 } | 166 } |
167 | 167 |
168 void ServiceProcessState::TearDownState() { | 168 void ServiceProcessState::TearDownState() { |
169 delete state_; | 169 delete state_; |
170 state_ = NULL; | 170 state_ = NULL; |
171 } | 171 } |
OLD | NEW |