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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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/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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 std::string id = cmd_line.GetSwitchValueASCII(switches::kInstallFromWebstore); 291 std::string id = cmd_line.GetSwitchValueASCII(switches::kInstallFromWebstore);
292 if (!Extension::IdIsValid(id)) { 292 if (!Extension::IdIsValid(id)) {
293 LOG(ERROR) << "Invalid id for " << switches::kInstallFromWebstore 293 LOG(ERROR) << "Invalid id for " << switches::kInstallFromWebstore
294 << " : '" << id << "'"; 294 << " : '" << id << "'";
295 return false; 295 return false;
296 } 296 }
297 297
298 AppInstallHelper helper; 298 AppInstallHelper helper;
299 helper.BeginInstall(profile, id, 299 helper.BeginInstall(profile, id,
300 !cmd_line.HasSwitch(switches::kForceAppMode), 300 !cmd_line.HasSwitch(switches::kForceAppMode),
301 MessageLoop::QuitWhenIdleClosure()); 301 base::MessageLoop::QuitWhenIdleClosure());
302 302
303 MessageLoop::current()->Run(); 303 base::MessageLoop::current()->Run();
304 if (!helper.success()) 304 if (!helper.success())
305 LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error(); 305 LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error();
306 return helper.success(); 306 return helper.success();
307 } 307 }
308 308
309 void StartupHelper::LimitedInstallFromWebstore( 309 void StartupHelper::LimitedInstallFromWebstore(
310 const CommandLine& cmd_line, 310 const CommandLine& cmd_line,
311 Profile* profile, 311 Profile* profile,
312 base::Callback<void()> done_callback) { 312 base::Callback<void()> done_callback) {
313 std::string id = WebStoreIdFromLimitedInstallCmdLine(cmd_line); 313 std::string id = WebStoreIdFromLimitedInstallCmdLine(cmd_line);
(...skipping 21 matching lines...) Expand all
335 } 335 }
336 return id; 336 return id;
337 } 337 }
338 338
339 StartupHelper::~StartupHelper() { 339 StartupHelper::~StartupHelper() {
340 if (pack_job_) 340 if (pack_job_)
341 pack_job_->ClearClient(); 341 pack_job_->ClearClient();
342 } 342 }
343 343
344 } // namespace extensions 344 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/standard_management_policy_provider_unittest.cc ('k') | chrome/browser/extensions/state_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698