OLD | NEW |
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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 kNoPreviousBeginInstallWithManifestError, id); | 433 kNoPreviousBeginInstallWithManifestError, id); |
434 return false; | 434 return false; |
435 } | 435 } |
436 | 436 |
437 // Balanced in OnExtensionInstallSuccess() or OnExtensionInstallFailure(). | 437 // Balanced in OnExtensionInstallSuccess() or OnExtensionInstallFailure(). |
438 AddRef(); | 438 AddRef(); |
439 | 439 |
440 #if defined(OS_WIN) | 440 #if defined(OS_WIN) |
441 if (approval_->enable_launcher) { | 441 if (approval_->enable_launcher) { |
442 if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) { | 442 if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) { |
| 443 LOG(INFO) << "Enabling App Launcher via installation"; |
443 extensions::AppHostInstaller::SetInstallWithLauncher(true); | 444 extensions::AppHostInstaller::SetInstallWithLauncher(true); |
444 extensions::AppHostInstaller::EnsureAppHostInstalled( | 445 extensions::AppHostInstaller::EnsureAppHostInstalled( |
445 base::Bind(&CompleteInstallFunction::AfterMaybeInstallAppLauncher, | 446 base::Bind(&CompleteInstallFunction::AfterMaybeInstallAppLauncher, |
446 this)); | 447 this)); |
447 return true; | 448 return true; |
448 } else { | 449 } else { |
| 450 LOG(INFO) << "Enabling App Launcher via flags"; |
449 about_flags::SetExperimentEnabled(g_browser_process->local_state(), | 451 about_flags::SetExperimentEnabled(g_browser_process->local_state(), |
450 switches::kShowAppListShortcut, | 452 switches::kShowAppListShortcut, |
451 true); | 453 true); |
452 } | 454 } |
453 } | 455 } |
454 #endif | 456 #endif |
455 AfterMaybeInstallAppLauncher(true); | 457 AfterMaybeInstallAppLauncher(true); |
456 | 458 |
457 return true; | 459 return true; |
458 } | 460 } |
459 | 461 |
460 void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) { | 462 void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) { |
| 463 if (!ok) |
| 464 LOG(ERROR) << "Error installing app launcher"; |
461 apps::GetIsAppLauncherEnabled(base::Bind( | 465 apps::GetIsAppLauncherEnabled(base::Bind( |
462 &CompleteInstallFunction::OnGetAppLauncherEnabled, this, | 466 &CompleteInstallFunction::OnGetAppLauncherEnabled, this, |
463 approval_->extension_id)); | 467 approval_->extension_id)); |
464 } | 468 } |
465 | 469 |
466 void CompleteInstallFunction::OnGetAppLauncherEnabled( | 470 void CompleteInstallFunction::OnGetAppLauncherEnabled( |
467 std::string id, | 471 std::string id, |
468 bool app_launcher_enabled) { | 472 bool app_launcher_enabled) { |
469 if (app_launcher_enabled) { | 473 if (app_launcher_enabled) { |
470 std::string name; | 474 std::string name; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); | 588 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); |
585 return true; | 589 return true; |
586 } | 590 } |
587 | 591 |
588 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { | 592 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { |
589 SetResult(Value::CreateBooleanValue(is_enabled)); | 593 SetResult(Value::CreateBooleanValue(is_enabled)); |
590 SendResponse(true); | 594 SendResponse(true); |
591 } | 595 } |
592 | 596 |
593 } // namespace extensions | 597 } // namespace extensions |
OLD | NEW |