Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8022)

Unified Diff: chrome/installer/setup/install_worker.cc

Issue 10160011: Create VisualElementsManifest.xml from template -- install VisualElements in the version directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new line at end of install_unittest.cc Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/install_worker.cc
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index cd17feea47e150abf09e29bb9bc847b780027d0f..74d9a8f68b1c278f022f2b8e296ed363ebf3eaea 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -10,6 +10,7 @@
#include <oaidl.h>
#include <shlobj.h>
#include <time.h>
+
#include <vector>
#include "base/command_line.h"
@@ -775,35 +776,22 @@ void AddInstallWorkItems(const InstallationState& original_state,
WorkItem::ALWAYS_MOVE);
}
- if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
- // Desktop only (i.e. not supporting Metro) versions of Chromium do not have
- // to include visual elements.
- scoped_ptr<WorkItemList> win8_work_items(
- WorkItem::CreateConditionalWorkItemList(new ConditionRunIfFileExists(
- src_path.Append(L"visualelementsmanifest.xml"))));
- // TODO (gab): All of these hard-coded strings are temporary and will be
- // deleted in the patch following this one.
- win8_work_items->AddMoveTreeWorkItem(
- src_path.Append(L"visualelementsmanifest.xml").value(),
- target_path.Append(L"visualelementsmanifest.xml").value(),
- temp_path.value(),
- WorkItem::ALWAYS_MOVE);
- win8_work_items->AddMoveTreeWorkItem(
- src_path.Append(L"logo.png").value(),
- target_path.Append(L"logo.png").value(),
- temp_path.value(),
- WorkItem::ALWAYS_MOVE);
- win8_work_items->AddMoveTreeWorkItem(
- src_path.Append(L"smalllogo.png").value(),
- target_path.Append(L"smalllogo.png").value(),
- temp_path.value(),
- WorkItem::ALWAYS_MOVE);
- win8_work_items->AddMoveTreeWorkItem(
- src_path.Append(L"splash-620x300.png").value(),
- target_path.Append(L"splash-620x300.png").value(),
+ // Install kVisualElementsManifest if it is present in |src_path|. No need to
+ // make this a conditional work item as if the file is not there now, it will
+ // never be.
+ if (file_util::PathExists(
+ src_path.Append(installer::kVisualElementsManifest))) {
+ install_list->AddMoveTreeWorkItem(
+ src_path.Append(installer::kVisualElementsManifest).value(),
+ target_path.Append(installer::kVisualElementsManifest).value(),
temp_path.value(),
WorkItem::ALWAYS_MOVE);
- install_list->AddWorkItem(win8_work_items.release());
+ } else {
+ // We do not want to have an old VisualElementsManifest pointing to an old
+ // version directory. Delete it as there wasn't a new one to replace it.
+ install_list->AddDeleteTreeWorkItem(
+ target_path.Append(installer::kVisualElementsManifest),
+ temp_path);
}
// In the past, we copied rather than moved for system level installs so that
@@ -822,14 +810,6 @@ void AddInstallWorkItems(const InstallationState& original_state,
check_for_duplicates ? WorkItem::CHECK_DUPLICATES :
WorkItem::ALWAYS_MOVE);
- // Copy the default Dictionaries only if the folder doesn't exist already.
- // TODO(grt): Use AddMoveTreeWorkItem in a conditional WorkItemList, which
- // will be more efficient in space and time.
- install_list->AddCopyTreeWorkItem(
- src_path.Append(installer::kDictionaries).value(),
- target_path.Append(installer::kDictionaries).value(),
- temp_path.value(), WorkItem::IF_NOT_PRESENT);
-
// Delete any old_chrome.exe if present (ignore failure if it's in use).
install_list->AddDeleteTreeWorkItem(
target_path.Append(installer::kChromeOldExe), temp_path)

Powered by Google App Engine
This is Rietveld 408576698