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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 16172005: Clean up async app launcher enabled checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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/api/webstore_private/webstore_private_api.h" 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h"
6 6
7 #include "apps/app_launcher.h" 7 #include "apps/app_launcher.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/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } else { 505 } else {
506 AfterMaybeInstallAppLauncher(true); 506 AfterMaybeInstallAppLauncher(true);
507 } 507 }
508 508
509 return true; 509 return true;
510 } 510 }
511 511
512 void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) { 512 void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) {
513 if (!ok) 513 if (!ok)
514 LOG(ERROR) << "Error installing app launcher"; 514 LOG(ERROR) << "Error installing app launcher";
515 apps::GetIsAppLauncherEnabled(base::Bind( 515 std::string id = approval_->extension_id;
516 &CompleteInstallFunction::OnGetAppLauncherEnabled, this, 516 if (apps::IsAppLauncherEnabled()) {
517 approval_->extension_id));
518 }
519
520 void CompleteInstallFunction::OnGetAppLauncherEnabled(
koz (OOO until 15th September) 2013/05/30 04:08:40 Remove function declaration.
calamity 2013/05/31 01:15:22 Done.
521 std::string id,
522 bool app_launcher_enabled) {
523 if (app_launcher_enabled) {
524 std::string name; 517 std::string name;
525 if (!approval_->manifest->value()->GetString(extension_manifest_keys::kName, 518 if (!approval_->manifest->value()->GetString(extension_manifest_keys::kName,
526 &name)) { 519 &name)) {
527 NOTREACHED(); 520 NOTREACHED();
528 } 521 }
529 // Show the app list so it receives install progress notifications. 522 // Show the app list so it receives install progress notifications.
530 if (approval_->manifest->is_app()) 523 if (approval_->manifest->is_app())
531 AppListService::Get()->ShowAppList(profile()); 524 AppListService::Get()->ShowAppList(profile());
532 525
533 extensions::InstallTracker* tracker = 526 extensions::InstallTracker* tracker =
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 feature_checker_->CheckGPUFeatureAvailability(); 630 feature_checker_->CheckGPUFeatureAvailability();
638 return true; 631 return true;
639 } 632 }
640 633
641 void GetWebGLStatusFunction::OnFeatureCheck(bool feature_allowed) { 634 void GetWebGLStatusFunction::OnFeatureCheck(bool feature_allowed) {
642 CreateResult(feature_allowed); 635 CreateResult(feature_allowed);
643 SendResponse(true); 636 SendResponse(true);
644 } 637 }
645 638
646 bool GetIsLauncherEnabledFunction::RunImpl() { 639 bool GetIsLauncherEnabledFunction::RunImpl() {
647 apps::GetIsAppLauncherEnabled(base::Bind( 640 SetResult(Value::CreateBooleanValue(apps::IsAppLauncherEnabled()));
648 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); 641 SendResponse(true);
649 return true; 642 return true;
650 } 643 }
651 644
652 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) {
653 SetResult(Value::CreateBooleanValue(is_enabled));
654 SendResponse(true);
655 }
656
657 } // namespace extensions 645 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698