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 "apps/switches.h" |
8 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
11 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
12 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 16 #include "base/values.h" |
16 #include "chrome/browser/about_flags.h" | 17 #include "chrome/browser/about_flags.h" |
17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/extensions/crx_installer.h" | 19 #include "chrome/browser/extensions/crx_installer.h" |
19 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 20 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
20 #include "chrome/browser/extensions/extension_prefs.h" | 21 #include "chrome/browser/extensions/extension_prefs.h" |
21 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
22 #include "chrome/browser/extensions/extension_system.h" | 23 #include "chrome/browser/extensions/extension_system.h" |
23 #include "chrome/browser/extensions/install_tracker.h" | 24 #include "chrome/browser/extensions/install_tracker.h" |
24 #include "chrome/browser/extensions/install_tracker_factory.h" | 25 #include "chrome/browser/extensions/install_tracker_factory.h" |
25 #include "chrome/browser/extensions/webstore_installer.h" | 26 #include "chrome/browser/extensions/webstore_installer.h" |
26 #include "chrome/browser/gpu/gpu_feature_checker.h" | 27 #include "chrome/browser/gpu/gpu_feature_checker.h" |
27 #include "chrome/browser/profiles/profile_manager.h" | 28 #include "chrome/browser/profiles/profile_manager.h" |
28 #include "chrome/browser/signin/token_service.h" | 29 #include "chrome/browser/signin/token_service.h" |
29 #include "chrome/browser/signin/token_service_factory.h" | 30 #include "chrome/browser/signin/token_service_factory.h" |
30 #include "chrome/browser/sync/profile_sync_service.h" | 31 #include "chrome/browser/sync/profile_sync_service.h" |
31 #include "chrome/browser/sync/profile_sync_service_factory.h" | 32 #include "chrome/browser/sync/profile_sync_service_factory.h" |
32 #include "chrome/browser/ui/app_list/app_list_service.h" | 33 #include "chrome/browser/ui/app_list/app_list_service.h" |
33 #include "chrome/common/chrome_notification_types.h" | 34 #include "chrome/common/chrome_notification_types.h" |
34 #include "chrome/common/chrome_switches.h" | |
35 #include "chrome/common/extensions/extension.h" | 35 #include "chrome/common/extensions/extension.h" |
36 #include "chrome/common/extensions/extension_constants.h" | 36 #include "chrome/common/extensions/extension_constants.h" |
37 #include "chrome/common/extensions/extension_l10n_util.h" | 37 #include "chrome/common/extensions/extension_l10n_util.h" |
38 #include "chrome/common/extensions/extension_manifest_constants.h" | 38 #include "chrome/common/extensions/extension_manifest_constants.h" |
39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
40 #include "content/public/browser/gpu_data_manager.h" | 40 #include "content/public/browser/gpu_data_manager.h" |
41 #include "content/public/browser/notification_details.h" | 41 #include "content/public/browser/notification_details.h" |
42 #include "content/public/browser/notification_source.h" | 42 #include "content/public/browser/notification_source.h" |
43 #include "content/public/browser/web_contents.h" | 43 #include "content/public/browser/web_contents.h" |
44 #include "extensions/common/error_utils.h" | 44 #include "extensions/common/error_utils.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) { | 448 if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) { |
449 LOG(INFO) << "Enabling App Launcher via installation"; | 449 LOG(INFO) << "Enabling App Launcher via installation"; |
450 extensions::AppHostInstaller::SetInstallWithLauncher(true); | 450 extensions::AppHostInstaller::SetInstallWithLauncher(true); |
451 extensions::AppHostInstaller::EnsureAppHostInstalled( | 451 extensions::AppHostInstaller::EnsureAppHostInstalled( |
452 base::Bind(&CompleteInstallFunction::AfterMaybeInstallAppLauncher, | 452 base::Bind(&CompleteInstallFunction::AfterMaybeInstallAppLauncher, |
453 this)); | 453 this)); |
454 return true; | 454 return true; |
455 } else { | 455 } else { |
456 LOG(INFO) << "Enabling App Launcher via flags"; | 456 LOG(INFO) << "Enabling App Launcher via flags"; |
457 about_flags::SetExperimentEnabled(g_browser_process->local_state(), | 457 about_flags::SetExperimentEnabled(g_browser_process->local_state(), |
458 switches::kShowAppListShortcut, | 458 apps::switches::kShowAppListShortcut, |
459 true); | 459 true); |
460 } | 460 } |
461 } | 461 } |
462 #endif | 462 #endif |
463 AfterMaybeInstallAppLauncher(true); | 463 AfterMaybeInstallAppLauncher(true); |
464 | 464 |
465 return true; | 465 return true; |
466 } | 466 } |
467 | 467 |
468 void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) { | 468 void CompleteInstallFunction::AfterMaybeInstallAppLauncher(bool ok) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); | 597 &GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted, this)); |
598 return true; | 598 return true; |
599 } | 599 } |
600 | 600 |
601 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { | 601 void GetIsLauncherEnabledFunction::OnIsLauncherCheckCompleted(bool is_enabled) { |
602 SetResult(Value::CreateBooleanValue(is_enabled)); | 602 SetResult(Value::CreateBooleanValue(is_enabled)); |
603 SendResponse(true); | 603 SendResponse(true); |
604 } | 604 } |
605 | 605 |
606 } // namespace extensions | 606 } // namespace extensions |
OLD | NEW |