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

Side by Side Diff: chrome/browser/extensions/startup_helper.cc

Issue 238723008: Remove uninstall extensions command line switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Remove switch from chrome_switches.{h,cc} Created 6 years, 8 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 | « chrome/browser/extensions/startup_helper.h ('k') | chrome/common/chrome_switches.h » ('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) 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/extensions/startup_helper.h" 5 #include "chrome/browser/extensions/startup_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 helper->Start(); 188 helper->Start();
189 if (!helper->finished()) 189 if (!helper->finished())
190 run_loop.Run(); 190 run_loop.Run();
191 191
192 bool success = helper->success(); 192 bool success = helper->success();
193 if (!success) 193 if (!success)
194 *error = base::UTF16ToUTF8(helper->error()); 194 *error = base::UTF16ToUTF8(helper->error());
195 return success; 195 return success;
196 } 196 }
197 197
198 bool StartupHelper::UninstallExtension(const CommandLine& cmd_line,
199 Profile* profile) {
200 DCHECK(profile);
201
202 if (!cmd_line.HasSwitch(switches::kUninstallExtension))
203 return false;
204
205 ExtensionService* extension_service = profile->GetExtensionService();
206 if (!extension_service)
207 return false;
208
209 std::string extension_id = cmd_line.GetSwitchValueASCII(
210 switches::kUninstallExtension);
211 return ExtensionService::UninstallExtensionHelper(extension_service,
212 extension_id);
213 }
214
215 namespace { 198 namespace {
216 199
217 class AppInstallHelper { 200 class AppInstallHelper {
218 public: 201 public:
219 // A callback for when the install process is done. 202 // A callback for when the install process is done.
220 typedef base::Callback<void()> DoneCallback; 203 typedef base::Callback<void()> DoneCallback;
221 204
222 AppInstallHelper(); 205 AppInstallHelper();
223 virtual ~AppInstallHelper(); 206 virtual ~AppInstallHelper();
224 bool success() { return success_; } 207 bool success() { return success_; }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 314 }
332 return id; 315 return id;
333 } 316 }
334 317
335 StartupHelper::~StartupHelper() { 318 StartupHelper::~StartupHelper() {
336 if (pack_job_.get()) 319 if (pack_job_.get())
337 pack_job_->ClearClient(); 320 pack_job_->ClearClient();
338 } 321 }
339 322
340 } // namespace extensions 323 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/startup_helper.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698