diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 17:21:41 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 17:21:41 +0000 |
commit | 51a7a9daf25c8e05d93742e3e3ec7a955640ad37 (patch) | |
tree | 2a80ddb1d3bdbe8e735156ea530d8be88eae021b /chrome/browser/profiles | |
parent | febf46fcdc42e11527eae8421fd802651df60810 (diff) | |
download | chromium_src-51a7a9daf25c8e05d93742e3e3ec7a955640ad37.zip chromium_src-51a7a9daf25c8e05d93742e3e3ec7a955640ad37.tar.gz chromium_src-51a7a9daf25c8e05d93742e3e3ec7a955640ad37.tar.bz2 |
Change the way that default apps are installed to use a more standard
mechanism that already exists. Also uses a field trial object, with a one-
to-one correspondence between field trial group and brand code, so that metrics
can be collected and properly attributed to a given brand code. This allows
the metrics to be isolated by group and correlated with the brand code.
A follow CL will contain the changes to collect the metrics based on this
field trial.
BUG=None
TEST=Default apps should be installed for all profiles, not just the first
one, and not just on chrome first run, assuming the user is not in the
experimental group where default apps are not installed.
Review URL: http://codereview.chromium.org/8020009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profiles')
-rw-r--r-- | chrome/browser/profiles/profile_impl.cc | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 11fd5c0..993fb2d 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -26,7 +26,6 @@ #include "chrome/browser/custom_handlers/protocol_handler_registry.h" #include "chrome/browser/defaults.h" #include "chrome/browser/download/chrome_download_manager_delegate.h" -#include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_devtools_manager.h" #include "chrome/browser/extensions/extension_error_reporter.h" #include "chrome/browser/extensions/extension_event_router.h" @@ -40,13 +39,11 @@ #include "chrome/browser/extensions/extension_special_storage_policy.h" #include "chrome/browser/extensions/user_script_master.h" #include "chrome/browser/favicon/favicon_service.h" -#include "chrome/browser/first_run/first_run.h" #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/shortcuts_backend.h" #include "chrome/browser/history/top_sites.h" #include "chrome/browser/instant/instant_controller.h" -#include "chrome/browser/mac/keystone_glue.h" #include "chrome/browser/metrics/metrics_service.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/net/gaia/token_service.h" @@ -91,7 +88,6 @@ #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "chrome/common/spellcheck_messages.h" -#include "chrome/installer/util/google_update_settings.h" #include "content/browser/appcache/chrome_appcache_service.h" #include "content/browser/browser_thread.h" #include "content/browser/chrome_blob_storage_context.h" @@ -221,49 +217,6 @@ FilePath GetMediaCachePath(const FilePath& base) { return base.Append(chrome::kMediaCacheDirname); } -void DoInstallDefaultAppsOnUIThread(const FilePath& profile_path, - const std::list<FilePath>& crx_path_list) { - Profile* profile = - g_browser_process->profile_manager()->GetProfileByPath(profile_path); - if (profile) { - ExtensionService* extension_service = profile->GetExtensionService(); - for (std::list<FilePath>::const_iterator iter = crx_path_list.begin(); - iter != crx_path_list.end(); ++iter) { - scoped_refptr<CrxInstaller> crx_installer = - extension_service->MakeCrxInstaller(NULL); - crx_installer->set_allow_silent_install(true); - crx_installer->set_delete_source(false); - crx_installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE); - crx_installer->InstallCrx(*iter); - } - } -} - -void InstallDefaultApps(const FilePath& profile_path) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - - FilePath apps_dir; - FilePath file; - std::list<FilePath> crx_path_list; - - if (PathService::Get(chrome::DIR_DEFAULT_APPS, &apps_dir)) { - file_util::FileEnumerator file_enumerator(apps_dir, false, - file_util::FileEnumerator::FILES); - while (!(file = file_enumerator.Next()).value().empty()) { - if (LowerCaseEqualsASCII(file.Extension(), ".crx")) - crx_path_list.push_back(file); - } - } - // No need to post the task if nothing was there to install. - if (!crx_path_list.size()) - return; - - // Finish the install on the UI thread. - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - base::Bind(&DoInstallDefaultAppsOnUIThread, - profile_path, crx_path_list)); -} - // Simple task to log the size of the current profile. class ProfileSizeTask : public Task { public: @@ -575,28 +528,6 @@ void ProfileImpl::InitExtensions(bool extensions_enabled) { extensions_enabled)); RegisterComponentExtensions(); - -#if defined(GOOGLE_CHROME_BUILD) - // If first run and brand code not equal to ECDB, install default apps. -#if defined(OS_WIN) - string16 brand; - GoogleUpdateSettings::GetBrand(&brand); -#elif defined(OS_MACOSX) - std::string brand = keystone_glue::BrandCode(); -#else - std::string brand; -#endif - // TODO(caitkp): when we move to multi-profiles (M16) we will want to change - // this check, as |FirstRun::IsChromeFirstRun()| checks for the first run - // ever, not first run per profile. - if (FirstRun::IsChromeFirstRun() && - !LowerCaseEqualsASCII(brand, "ecdb")) { - BrowserThread::PostTask( - BrowserThread::FILE, FROM_HERE, - base::Bind(&InstallDefaultApps, GetPath())); - } -#endif - extension_service_->Init(); if (extensions_enabled) { |