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 "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
8 #include "base/command_line.h" | 9 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
10 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
11 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
14 #include "base/values.h" | 15 #include "base/values.h" |
15 #include "chrome/browser/about_flags.h" | 16 #include "chrome/browser/about_flags.h" |
16 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/extensions/app_launcher.h" | |
18 #include "chrome/browser/extensions/crx_installer.h" | 18 #include "chrome/browser/extensions/crx_installer.h" |
19 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 19 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
20 #include "chrome/browser/extensions/extension_prefs.h" | 20 #include "chrome/browser/extensions/extension_prefs.h" |
21 #include "chrome/browser/extensions/extension_service.h" | 21 #include "chrome/browser/extensions/extension_service.h" |
22 #include "chrome/browser/extensions/extension_system.h" | 22 #include "chrome/browser/extensions/extension_system.h" |
23 #include "chrome/browser/extensions/webstore_installer.h" | 23 #include "chrome/browser/extensions/webstore_installer.h" |
24 #include "chrome/browser/gpu/gpu_feature_checker.h" | 24 #include "chrome/browser/gpu/gpu_feature_checker.h" |
25 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
26 #include "chrome/browser/signin/token_service.h" | 26 #include "chrome/browser/signin/token_service.h" |
27 #include "chrome/browser/signin/token_service_factory.h" | 27 #include "chrome/browser/signin/token_service_factory.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 true); | 451 true); |
452 } | 452 } |
453 } | 453 } |
454 #endif | 454 #endif |
455 AfterMaybeInstallAppLauncher(true); | 455 AfterMaybeInstallAppLauncher(true); |
456 | 456 |
457 return true; | 457 return true; |
458 } | 458 } |
459 | 459 |
460 void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) { | 460 void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) { |
461 UpdateIsAppLauncherEnabled(base::Bind( | 461 apps::GetIsAppLauncherEnabled(base::Bind( |
462 &CompleteInstallFunction::OnGetAppLauncherEnabled, this, | 462 &CompleteInstallFunction::OnGetAppLauncherEnabled, this, |
463 approval_->extension_id)); | 463 approval_->extension_id)); |
464 } | 464 } |
465 | 465 |
466 void CompleteInstallFunction::OnGetAppLauncherEnabled( | 466 void CompleteInstallFunction::OnGetAppLauncherEnabled( |
467 std::string id, | 467 std::string id, |
468 bool app_launcher_enabled) { | 468 bool app_launcher_enabled) { |
469 if (app_launcher_enabled) { | 469 if (app_launcher_enabled) { |
470 std::string name; | 470 std::string name; |
471 #if defined(ENABLE_APP_LIST) | 471 #if defined(ENABLE_APP_LIST) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 feature_checker_->CheckGPUFeatureAvailability(); | 570 feature_checker_->CheckGPUFeatureAvailability(); |
571 return true; | 571 return true; |
572 } | 572 } |
573 | 573 |
574 void GetWebGLStatusFunction::OnFeatureCheck(bool feature_allowed) { | 574 void GetWebGLStatusFunction::OnFeatureCheck(bool feature_allowed) { |
575 CreateResult(feature_allowed); | 575 CreateResult(feature_allowed); |
576 SendResponse(true); | 576 SendResponse(true); |
577 } | 577 } |
578 | 578 |
579 bool GetIsLauncherEnabledFunction::RunImpl() { | 579 bool GetIsLauncherEnabledFunction::RunImpl() { |
580 UpdateIsAppLauncherEnabled(base::Bind( | 580 apps::GetIsAppLauncherEnabled(base::Bind( |
581 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); | 581 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); |
582 return true; | 582 return true; |
583 } | 583 } |
584 | 584 |
585 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { | 585 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { |
586 SetResult(Value::CreateBooleanValue(is_enabled)); | 586 SetResult(Value::CreateBooleanValue(is_enabled)); |
587 SendResponse(true); | 587 SendResponse(true); |
588 } | 588 } |
589 | 589 |
590 } // namespace extensions | 590 } // namespace extensions |
OLD | NEW |