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

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

Issue 235483005: extensions: Use base::RunLoop instead of deprecated MessageLoop methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 bool StartupHelper::InstallFromWebstore(const CommandLine& cmd_line, 286 bool StartupHelper::InstallFromWebstore(const CommandLine& cmd_line,
287 Profile* profile) { 287 Profile* profile) {
288 std::string id = cmd_line.GetSwitchValueASCII(switches::kInstallFromWebstore); 288 std::string id = cmd_line.GetSwitchValueASCII(switches::kInstallFromWebstore);
289 if (!Extension::IdIsValid(id)) { 289 if (!Extension::IdIsValid(id)) {
290 LOG(ERROR) << "Invalid id for " << switches::kInstallFromWebstore 290 LOG(ERROR) << "Invalid id for " << switches::kInstallFromWebstore
291 << " : '" << id << "'"; 291 << " : '" << id << "'";
292 return false; 292 return false;
293 } 293 }
294 294
295 AppInstallHelper helper; 295 AppInstallHelper helper;
296 helper.BeginInstall( 296 base::RunLoop run_loop;
297 profile, id, true, base::MessageLoop::QuitWhenIdleClosure()); 297 helper.BeginInstall(profile, id, true, run_loop.QuitClosure());
298 run_loop.Run();
298 299
299 base::MessageLoop::current()->Run();
300 if (!helper.success()) 300 if (!helper.success())
301 LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error(); 301 LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error();
302 return helper.success(); 302 return helper.success();
303 } 303 }
304 304
305 void StartupHelper::LimitedInstallFromWebstore( 305 void StartupHelper::LimitedInstallFromWebstore(
306 const CommandLine& cmd_line, 306 const CommandLine& cmd_line,
307 Profile* profile, 307 Profile* profile,
308 base::Callback<void()> done_callback) { 308 base::Callback<void()> done_callback) {
309 std::string id = WebStoreIdFromLimitedInstallCmdLine(cmd_line); 309 std::string id = WebStoreIdFromLimitedInstallCmdLine(cmd_line);
(...skipping 21 matching lines...) Expand all
331 } 331 }
332 return id; 332 return id;
333 } 333 }
334 334
335 StartupHelper::~StartupHelper() { 335 StartupHelper::~StartupHelper() {
336 if (pack_job_.get()) 336 if (pack_job_.get())
337 pack_job_->ClearClient(); 337 pack_job_->ClearClient();
338 } 338 }
339 339
340 } // namespace extensions 340 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698