| 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 "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "base/version.h" | 17 #include "base/version.h" |
| 18 #include "chrome/browser/about_flags.h" | 18 #include "chrome/browser/about_flags.h" |
| 19 #include "chrome/browser/apps/ephemeral_app_launcher.h" | 19 #include "chrome/browser/apps/ephemeral_app_launcher.h" |
| 20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/chrome_notification_types.h" | 21 #include "chrome/browser/chrome_notification_types.h" |
| 22 #include "chrome/browser/extensions/crx_installer.h" | 22 #include "chrome/browser/extensions/crx_installer.h" |
| 23 #include "chrome/browser/extensions/extension_install_ui_util.h" | 23 #include "chrome/browser/extensions/extension_install_ui_util.h" |
| 24 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
| 25 #include "chrome/browser/extensions/install_tracker.h" | 25 #include "chrome/browser/extensions/install_tracker.h" |
| 26 #include "chrome/browser/extensions/webstore_installer.h" | 26 #include "chrome/browser/extensions/webstore_installer.h" |
| 27 #include "chrome/browser/gpu/gpu_feature_checker.h" | 27 #include "chrome/browser/gpu/gpu_feature_checker.h" |
| 28 #include "chrome/browser/profiles/profile_manager.h" | 28 #include "chrome/browser/profiles/profile_manager.h" |
| 29 #include "chrome/browser/signin/signin_manager_factory.h" |
| 29 #include "chrome/browser/sync/profile_sync_service.h" | 30 #include "chrome/browser/sync/profile_sync_service.h" |
| 30 #include "chrome/browser/sync/profile_sync_service_factory.h" | 31 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 31 #include "chrome/browser/ui/app_list/app_list_service.h" | 32 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 32 #include "chrome/browser/ui/app_list/app_list_util.h" | 33 #include "chrome/browser/ui/app_list/app_list_util.h" |
| 33 #include "chrome/common/extensions/extension_constants.h" | 34 #include "chrome/common/extensions/extension_constants.h" |
| 34 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
| 35 #include "components/crx_file/id_util.h" | 36 #include "components/crx_file/id_util.h" |
| 37 #include "components/signin/core/browser/signin_manager.h" |
| 36 #include "content/public/browser/gpu_data_manager.h" | 38 #include "content/public/browser/gpu_data_manager.h" |
| 37 #include "content/public/browser/notification_details.h" | 39 #include "content/public/browser/notification_details.h" |
| 38 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
| 39 #include "content/public/browser/web_contents.h" | 41 #include "content/public/browser/web_contents.h" |
| 40 #include "extensions/browser/extension_function_dispatcher.h" | 42 #include "extensions/browser/extension_function_dispatcher.h" |
| 41 #include "extensions/browser/extension_prefs.h" | 43 #include "extensions/browser/extension_prefs.h" |
| 42 #include "extensions/browser/extension_registry.h" | 44 #include "extensions/browser/extension_registry.h" |
| 43 #include "extensions/browser/extension_system.h" | 45 #include "extensions/browser/extension_system.h" |
| 44 #include "extensions/browser/extension_util.h" | 46 #include "extensions/browser/extension_util.h" |
| 45 #include "extensions/common/error_utils.h" | 47 #include "extensions/common/error_utils.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 bool WebstorePrivateEnableAppLauncherFunction::RunSync() { | 518 bool WebstorePrivateEnableAppLauncherFunction::RunSync() { |
| 517 AppListService* app_list_service = AppListService::Get( | 519 AppListService* app_list_service = AppListService::Get( |
| 518 GetHostDesktopTypeForWebContents(GetAssociatedWebContents())); | 520 GetHostDesktopTypeForWebContents(GetAssociatedWebContents())); |
| 519 app_list_service->EnableAppList(GetProfile(), | 521 app_list_service->EnableAppList(GetProfile(), |
| 520 AppListService::ENABLE_VIA_WEBSTORE_LINK); | 522 AppListService::ENABLE_VIA_WEBSTORE_LINK); |
| 521 return true; | 523 return true; |
| 522 } | 524 } |
| 523 | 525 |
| 524 bool WebstorePrivateGetBrowserLoginFunction::RunSync() { | 526 bool WebstorePrivateGetBrowserLoginFunction::RunSync() { |
| 525 GetBrowserLogin::Results::Info info; | 527 GetBrowserLogin::Results::Info info; |
| 526 info.login = GetProfile()->GetOriginalProfile()->GetPrefs()->GetString( | 528 info.login = |
| 527 prefs::kGoogleServicesUsername); | 529 SigninManagerFactory::GetForProfile(GetProfile()->GetOriginalProfile()) |
| 530 ->GetAuthenticatedUsername(); |
| 528 results_ = GetBrowserLogin::Results::Create(info); | 531 results_ = GetBrowserLogin::Results::Create(info); |
| 529 return true; | 532 return true; |
| 530 } | 533 } |
| 531 | 534 |
| 532 bool WebstorePrivateGetStoreLoginFunction::RunSync() { | 535 bool WebstorePrivateGetStoreLoginFunction::RunSync() { |
| 533 results_ = GetStoreLogin::Results::Create(GetWebstoreLogin(GetProfile())); | 536 results_ = GetStoreLogin::Results::Create(GetWebstoreLogin(GetProfile())); |
| 534 return true; | 537 return true; |
| 535 } | 538 } |
| 536 | 539 |
| 537 bool WebstorePrivateSetStoreLoginFunction::RunSync() { | 540 bool WebstorePrivateSetStoreLoginFunction::RunSync() { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 WebstorePrivateGetEphemeralAppsEnabledFunction:: | 701 WebstorePrivateGetEphemeralAppsEnabledFunction:: |
| 699 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} | 702 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} |
| 700 | 703 |
| 701 bool WebstorePrivateGetEphemeralAppsEnabledFunction::RunSync() { | 704 bool WebstorePrivateGetEphemeralAppsEnabledFunction::RunSync() { |
| 702 results_ = GetEphemeralAppsEnabled::Results::Create( | 705 results_ = GetEphemeralAppsEnabled::Results::Create( |
| 703 EphemeralAppLauncher::IsFeatureEnabled()); | 706 EphemeralAppLauncher::IsFeatureEnabled()); |
| 704 return true; | 707 return true; |
| 705 } | 708 } |
| 706 | 709 |
| 707 } // namespace extensions | 710 } // namespace extensions |
| OLD | NEW |