diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/installer/setup/install_worker.cc | 60 | ||||
-rw-r--r-- | chrome/installer/setup/install_worker.h | 17 | ||||
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 31 | ||||
-rw-r--r-- | chrome/installer/util/browser_distribution.cc | 9 | ||||
-rw-r--r-- | chrome/installer/util/browser_distribution.h | 10 | ||||
-rw-r--r-- | chrome/installer/util/chrome_frame_distribution.cc | 8 | ||||
-rw-r--r-- | chrome/installer/util/chrome_frame_distribution.h | 5 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_distribution.cc | 19 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_distribution.h | 5 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_distribution_dummy.cc | 10 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_sxs_distribution.cc | 10 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_sxs_distribution.h | 6 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.cc | 15 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.h | 10 |
14 files changed, 142 insertions, 73 deletions
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index ce8a456..f3f66f4 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -292,9 +292,6 @@ void AddProductSpecificWorkItems(const InstallationState& original_state, if (p.is_chrome_frame()) { AddChromeFrameWorkItems(original_state, installer_state, setup_path, new_version, p, list); - } else if (p.is_chrome()) { - AddChromeWorkItems(original_state, installer_state, setup_path, - new_version, p, list); } } } @@ -825,6 +822,9 @@ void AddInstallWorkItems(const InstallationState& original_state, AddVersionKeyWorkItems(root, product->distribution(), new_version, add_language_identifier, install_list); + + AddDelegateExecuteWorkItems(original_state, installer_state, setup_path, + new_version, *product, install_list); } if (installer_state.is_multi_install()) { @@ -1030,25 +1030,36 @@ void AddChromeFrameWorkItems(const InstallationState& original_state, } } -void AddChromeWorkItems(const InstallationState& original_state, - const InstallerState& installer_state, - const FilePath& setup_path, - const Version& new_version, - const Product& product, - WorkItemList* list) { - // For the moment, this function adds work items to perform COM registration - // specific to the Windows 8 delegate. If more work needs to be done in the - // future, pull this into its own function called by AddChromeWorkItems. - DCHECK(product.is_chrome()); +void AddDelegateExecuteWorkItems(const InstallationState& original_state, + const InstallerState& installer_state, + const FilePath& setup_path, + const Version& new_version, + const Product& product, + WorkItemList* list) { + string16 handler_class_uuid; + string16 type_lib_uuid; + string16 type_lib_version; + string16 interface_uuid; + BrowserDistribution* distribution = product.distribution(); + if (!distribution->GetDelegateExecuteHandlerData( + &handler_class_uuid, &type_lib_uuid, &type_lib_version, + &interface_uuid)) { + VLOG(1) << "No DelegateExecute verb handler processing to do for " + << distribution->GetAppShortCutName(); + return; + } + + VLOG(1) << "DelegateExecute verb handler COM registration."; + HKEY root = installer_state.root_key(); const bool is_install = (installer_state.operation() != InstallerState::UNINSTALL); string16 delegate_execute_path(L"Software\\Classes\\CLSID\\"); - delegate_execute_path.append(kCommandExecuteImplUuid); + delegate_execute_path.append(handler_class_uuid); string16 typelib_path(L"Software\\Classes\\TypeLib\\"); - typelib_path.append(kDelegateExecuteLibUuid); + typelib_path.append(type_lib_uuid); string16 interface_path(L"Software\\Classes\\Interface\\"); - interface_path.append(kICommandExecuteImplUuid); + interface_path.append(interface_uuid); if (is_install) { // The path to the exe (in the version directory). @@ -1077,22 +1088,20 @@ void AddChromeWorkItems(const InstallationState& original_state, subkey.assign(delegate_execute_path).append(L"\\TypeLib"); list->AddCreateRegKeyWorkItem(root, subkey); - list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibUuid, - true); + list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_uuid, true); subkey.assign(delegate_execute_path).append(L"\\Version"); list->AddCreateRegKeyWorkItem(root, subkey); - list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibVersion, - true); + list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_version, true); // Register the DelegateExecuteLib type library at // Software\Classes\TypeLib\{4E805ED8-EBA0-4601-9681-12815A56EBFD} list->AddCreateRegKeyWorkItem(root, typelib_path); string16 version_key(typelib_path); - version_key.append(1, L'\\').append(kDelegateExecuteLibVersion); + version_key.append(1, L'\\').append(type_lib_version); list->AddCreateRegKeyWorkItem(root, version_key); - list->AddSetRegValueWorkItem(root, version_key, L"", kDelegateExecuteLib, + list->AddSetRegValueWorkItem(root, version_key, L"", L"DelegateExecuteLib", true); subkey.assign(version_key).append(L"\\FLAGS"); @@ -1117,7 +1126,7 @@ void AddChromeWorkItems(const InstallationState& original_state, // Software\Classes\Interface\{0BA0D4E9-2259-4963-B9AE-A839F7CB7544} list->AddCreateRegKeyWorkItem(root, interface_path); list->AddSetRegValueWorkItem(root, interface_path, L"", - kICommandExecuteImpl, true); + L"ICommandExecuteImpl", true); subkey.assign(interface_path).append(L"\\ProxyStubClsid32"); list->AddCreateRegKeyWorkItem(root, subkey); @@ -1125,10 +1134,9 @@ void AddChromeWorkItems(const InstallationState& original_state, subkey.assign(interface_path).append(L"\\TypeLib"); list->AddCreateRegKeyWorkItem(root, subkey); - list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibUuid, + list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_uuid, true); + list->AddSetRegValueWorkItem(root, subkey, L"Version", type_lib_version, true); - list->AddSetRegValueWorkItem(root, subkey, L"Version", - kDelegateExecuteLibVersion, true); } else { list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); diff --git a/chrome/installer/setup/install_worker.h b/chrome/installer/setup/install_worker.h index d486c61..2eefc74 100644 --- a/chrome/installer/setup/install_worker.h +++ b/chrome/installer/setup/install_worker.h @@ -122,15 +122,14 @@ void AddChromeFrameWorkItems(const InstallationState& original_state, const Product& product, WorkItemList* list); -// Called for either installation or uninstallation. This method updates the -// registry according to Chrome specific options for the current installation. -// This includes handling of the delegate execute server. -void AddChromeWorkItems(const InstallationState& original_state, - const InstallerState& installer_state, - const FilePath& setup_path, - const Version& new_version, - const Product& product, - WorkItemList* list); +// Called for either installation or uninstallation. This method adds or +// removes COM registration for a product's DelegateExecute verb handler. +void AddDelegateExecuteWorkItems(const InstallationState& original_state, + const InstallerState& installer_state, + const FilePath& setup_path, + const Version& new_version, + const Product& product, + WorkItemList* list); // This method adds work items to create (or update) Chrome uninstall entry in // either the Control Panel->Add/Remove Programs list or in the Omaha client diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 5b6e62c..cb80ee8 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -689,16 +689,17 @@ const wchar_t kChromeExtProgId[] = L"ChromiumExt"; } } -bool ProcessChromeWorkItems(const InstallationState& original_state, - const InstallerState& installer_state, - const FilePath& setup_path, - const Product& product) { - if (!product.is_chrome()) - return false; - - scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); - AddChromeWorkItems(original_state, installer_state, setup_path, Version(), - product, item_list.get()); +// Builds and executes a work item list to remove DelegateExecute verb handler +// work items for |product|. This will be a noop for products whose +// corresponding BrowserDistribution implementations do not publish +// DelegateExecute data via an implementation of GetDelegateExecuteHandlerData. +bool ProcessDelegateExecuteWorkItems(const InstallationState& original_state, + const InstallerState& installer_state, + const FilePath& setup_path, + const Product& product) { + scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); + AddDelegateExecuteWorkItems(original_state, installer_state, setup_path, + Version(), product, item_list.get()); return item_list->Do(); } @@ -709,7 +710,7 @@ bool ProcessChromeFrameWorkItems(const InstallationState& original_state, if (!product.is_chrome_frame()) return false; - scoped_ptr<WorkItemList> item_list(WorkItem::CreateWorkItemList()); + scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); AddChromeFrameWorkItems(original_state, installer_state, setup_path, Version(), product, item_list.get()); return item_list->Do(); @@ -819,10 +820,10 @@ InstallStatus UninstallProduct(const InstallationState& original_state, suffix, installer_state.target_path(), &ret); } - if (is_chrome) { - ProcessChromeWorkItems(original_state, installer_state, setup_path, - product); - } else { + ProcessDelegateExecuteWorkItems(original_state, installer_state, setup_path, + product); + + if (!is_chrome) { ProcessChromeFrameWorkItems(original_state, installer_state, setup_path, product); } diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc index 9272823..65b8348 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc @@ -229,6 +229,15 @@ bool BrowserDistribution::GetChromeChannel(std::wstring* channel) { return false; } +bool BrowserDistribution::GetDelegateExecuteHandlerData( + string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid) { + // TODO(grt): http://crbug.com/123727 Return values for Chromium. + return false; +} + void BrowserDistribution::UpdateInstallStatus(bool system_install, installer::ArchiveType archive_type, installer::InstallStatus install_status) { diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h index 520bc92..060c386 100644 --- a/chrome/installer/util/browser_distribution.h +++ b/chrome/installer/util/browser_distribution.h @@ -116,6 +116,16 @@ class BrowserDistribution { virtual bool GetChromeChannel(std::wstring* channel); + // Returns true if the distribution includes a DelegateExecute verb handler, + // and provides the COM registration data if so: + // |handler_class_uuid| is the CommandExecuteImpl class UUID. + // |type_lib_uuid| and |type_lib_version| identify its type library. + // |interface_uuid| is the ICommandExecuteImpl interface UUID. + virtual bool GetDelegateExecuteHandlerData(string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid); + virtual void UpdateInstallStatus(bool system_install, installer::ArchiveType archive_type, installer::InstallStatus install_status); diff --git a/chrome/installer/util/chrome_frame_distribution.cc b/chrome/installer/util/chrome_frame_distribution.cc index ec84f23..efa4c3b 100644 --- a/chrome/installer/util/chrome_frame_distribution.cc +++ b/chrome/installer/util/chrome_frame_distribution.cc @@ -122,6 +122,14 @@ bool ChromeFrameDistribution::CanCreateDesktopShortcuts() { return false; } +bool ChromeFrameDistribution::GetDelegateExecuteHandlerData( + string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid) { + return false; +} + void ChromeFrameDistribution::UpdateInstallStatus(bool system_install, installer::ArchiveType archive_type, installer::InstallStatus install_status) { diff --git a/chrome/installer/util/chrome_frame_distribution.h b/chrome/installer/util/chrome_frame_distribution.h index a29f472..d7b1275 100644 --- a/chrome/installer/util/chrome_frame_distribution.h +++ b/chrome/installer/util/chrome_frame_distribution.h @@ -55,6 +55,11 @@ class ChromeFrameDistribution : public BrowserDistribution { virtual bool CanCreateDesktopShortcuts() OVERRIDE; + virtual bool GetDelegateExecuteHandlerData(string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid) OVERRIDE; + virtual void UpdateInstallStatus(bool system_install, installer::ArchiveType archive_type, installer::InstallStatus install_status) OVERRIDE; diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index 118a283..c314ce6 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -49,6 +49,13 @@ namespace { const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}"; const wchar_t kBrowserAppId[] = L"Chrome"; +const wchar_t kCommandExecuteImplUuid[] = + L"{5C65F4B0-3651-4514-B207-D10CB699B14B}"; +const wchar_t kDelegateExecuteLibUuid[] = + L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}"; +const wchar_t kDelegateExecuteLibVersion[] = L"1.0"; +const wchar_t kICommandExecuteImplUuid[] = + L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}"; // The following strings are the possible outcomes of the toast experiment // as recorded in the |client| field. @@ -526,6 +533,18 @@ std::wstring GoogleChromeDistribution::GetVersionKey() { return key; } +bool GoogleChromeDistribution::GetDelegateExecuteHandlerData( + string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid) { + *handler_class_uuid = kCommandExecuteImplUuid; + *type_lib_uuid = kDelegateExecuteLibUuid; + *type_lib_version = kDelegateExecuteLibVersion; + *interface_uuid = kICommandExecuteImplUuid; + return true; +} + // This method checks if we need to change "ap" key in Google Update to try // full installer as fall back method in case incremental installer fails. // - If incremental installer fails we append a magic string ("-full"), if diff --git a/chrome/installer/util/google_chrome_distribution.h b/chrome/installer/util/google_chrome_distribution.h index 64ed1f1..743bd38 100644 --- a/chrome/installer/util/google_chrome_distribution.h +++ b/chrome/installer/util/google_chrome_distribution.h @@ -74,6 +74,11 @@ class GoogleChromeDistribution : public BrowserDistribution { virtual std::wstring GetVersionKey() OVERRIDE; + virtual bool GetDelegateExecuteHandlerData(string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid) OVERRIDE; + virtual void UpdateInstallStatus( bool system_install, installer::ArchiveType archive_type, diff --git a/chrome/installer/util/google_chrome_distribution_dummy.cc b/chrome/installer/util/google_chrome_distribution_dummy.cc index 592e2f2..d3e8ff2 100644 --- a/chrome/installer/util/google_chrome_distribution_dummy.cc +++ b/chrome/installer/util/google_chrome_distribution_dummy.cc @@ -111,6 +111,16 @@ std::wstring GoogleChromeDistribution::GetVersionKey() { return std::wstring(); } +bool GoogleChromeDistribution::GetDelegateExecuteHandlerData( + string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid) { + NOTREACHED(); + return false; +} + + void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, installer::ArchiveType archive_type, installer::InstallStatus install_status) { diff --git a/chrome/installer/util/google_chrome_sxs_distribution.cc b/chrome/installer/util/google_chrome_sxs_distribution.cc index 883994d..195ea69 100644 --- a/chrome/installer/util/google_chrome_sxs_distribution.cc +++ b/chrome/installer/util/google_chrome_sxs_distribution.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -62,6 +62,14 @@ bool GoogleChromeSxSDistribution::GetChromeChannel(std::wstring* channel) { return true; } +bool GoogleChromeSxSDistribution::GetDelegateExecuteHandlerData( + string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid) { + return false; +} + std::wstring GoogleChromeSxSDistribution::ChannelName() { return kChannelName; } diff --git a/chrome/installer/util/google_chrome_sxs_distribution.h b/chrome/installer/util/google_chrome_sxs_distribution.h index cd5c039..77ff4173 100644 --- a/chrome/installer/util/google_chrome_sxs_distribution.h +++ b/chrome/installer/util/google_chrome_sxs_distribution.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -27,6 +27,10 @@ class GoogleChromeSxSDistribution : public GoogleChromeDistribution { virtual bool CanSetAsDefault() OVERRIDE; virtual int GetIconIndex() OVERRIDE; virtual bool GetChromeChannel(std::wstring* channel) OVERRIDE; + virtual bool GetDelegateExecuteHandlerData(string16* handler_class_uuid, + string16* type_lib_uuid, + string16* type_lib_version, + string16* interface_uuid) OVERRIDE; // returns the channel name for GoogleChromeSxSDistribution static std::wstring ChannelName(); private: diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc index c97ac69..cbbec7a 100644 --- a/chrome/installer/util/util_constants.cc +++ b/chrome/installer/util/util_constants.cc @@ -179,6 +179,9 @@ const wchar_t kInstallerDir[] = L"Installer"; const wchar_t kInstallTempDir[] = L"Temp"; const wchar_t kInstallUserDataDir[] = L"User Data"; const wchar_t kNaClExe[] = L"nacl64.exe"; +// The CLSID of the proxy stub OLE Automation universal marshaler, the default +// marshaler for all interfaces. +const wchar_t kPSOAInterfaceUuid[] = L"{00020424-0000-0000-C000-000000000046}"; const wchar_t kSetupExe[] = L"setup.exe"; const wchar_t kSxSSuffix[] = L" SxS"; const wchar_t kUninstallStringField[] = L"UninstallString"; @@ -208,16 +211,4 @@ const wchar_t kChromeChannelDev[] = L"dev"; const wchar_t kChromeChannelBeta[] = L"beta"; const wchar_t kChromeChannelStable[] = L""; -// See delegate_execute.idl. -const wchar_t kCommandExecuteImplUuid[] = - L"{5C65F4B0-3651-4514-B207-D10CB699B14B}"; -const wchar_t kDelegateExecuteLib[] = L"DelegateExecuteLib"; -const wchar_t kDelegateExecuteLibUuid[] = - L"{4E805ED8-EBA0-4601-9681-12815A56EBFD}"; -const wchar_t kDelegateExecuteLibVersion[] = L"1.0"; -const wchar_t kICommandExecuteImpl[] = L"ICommandExecuteImpl"; -const wchar_t kICommandExecuteImplUuid[] = - L"{0BA0D4E9-2259-4963-B9AE-A839F7CB7544}"; -const wchar_t kPSOAInterfaceUuid[] = L"{00020424-0000-0000-C000-000000000046}"; - } // namespace installer diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index d2b4bb2..fc8f7b2 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -184,6 +184,7 @@ extern const wchar_t kInstallerDir[]; extern const wchar_t kInstallTempDir[]; extern const wchar_t kInstallUserDataDir[]; extern const wchar_t kNaClExe[]; +extern const wchar_t kPSOAInterfaceUuid[]; extern const wchar_t kSetupExe[]; extern const wchar_t kSxSSuffix[]; extern const wchar_t kUninstallArgumentsField[]; @@ -216,15 +217,6 @@ extern const wchar_t kChromeChannelDev[]; extern const wchar_t kChromeChannelBeta[]; extern const wchar_t kChromeChannelStable[]; -// Delegate Execute registration values. -extern const wchar_t kCommandExecuteImplUuid[]; -extern const wchar_t kDelegateExecuteLib[]; -extern const wchar_t kDelegateExecuteLibUuid[]; -extern const wchar_t kDelegateExecuteLibVersion[]; -extern const wchar_t kICommandExecuteImpl[]; -extern const wchar_t kICommandExecuteImplUuid[]; -extern const wchar_t kPSOAInterfaceUuid[]; - } // namespace installer #endif // CHROME_INSTALLER_UTIL_UTIL_CONSTANTS_H_ |