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

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

Issue 14381004: Two fixes for the limited install from webstore flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 Profile* profile, 315 Profile* profile,
316 base::Callback<void()> done_callback) { 316 base::Callback<void()> done_callback) {
317 std::string id = WebStoreIdFromLimitedInstallCmdLine(cmd_line); 317 std::string id = WebStoreIdFromLimitedInstallCmdLine(cmd_line);
318 if (!Extension::IdIsValid(id)) { 318 if (!Extension::IdIsValid(id)) {
319 LOG(ERROR) << "Invalid index for " << switches::kLimitedInstallFromWebstore; 319 LOG(ERROR) << "Invalid index for " << switches::kLimitedInstallFromWebstore;
320 done_callback.Run(); 320 done_callback.Run();
321 return; 321 return;
322 } 322 }
323 323
324 AppInstallHelper* helper = new AppInstallHelper(); 324 AppInstallHelper* helper = new AppInstallHelper();
325 helper->BeginInstall(profile, id, true /*show_prompt*/, 325 helper->BeginInstall(profile, id, false /*show_prompt*/,
326 base::Bind(&DeleteHelperAndRunCallback, 326 base::Bind(&DeleteHelperAndRunCallback,
327 helper, done_callback)); 327 helper, done_callback));
328 } 328 }
329 329
330 std::string StartupHelper::WebStoreIdFromLimitedInstallCmdLine( 330 std::string StartupHelper::WebStoreIdFromLimitedInstallCmdLine(
331 const CommandLine& cmd_line) { 331 const CommandLine& cmd_line) {
332 std::string index = cmd_line.GetSwitchValueASCII( 332 std::string index = cmd_line.GetSwitchValueASCII(
333 switches::kLimitedInstallFromWebstore); 333 switches::kLimitedInstallFromWebstore);
334 std::string id; 334 std::string id;
335 if (index == "1") { 335 if (index == "1") {
336 id = "nckgahadagoaajjgafhacjanaoiihapd"; 336 id = "nckgahadagoaajjgafhacjanaoiihapd";
337 } else if (index == "2") { 337 } else if (index == "2") {
338 id = "ecglahbcnmdpdciemllbhojghbkagdje"; 338 id = "ecglahbcnmdpdciemllbhojghbkagdje";
339 } 339 }
340 return id; 340 return id;
341 } 341 }
342 342
343 StartupHelper::~StartupHelper() { 343 StartupHelper::~StartupHelper() {
344 if (pack_job_) 344 if (pack_job_)
345 pack_job_->ClearClient(); 345 pack_job_->ClearClient();
346 } 346 }
347 347
348 } // namespace extensions 348 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698