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

Side by Side Diff: chrome/installer/setup/install.cc

Issue 2073123003: Update Windows start menu art (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/installer/setup/install_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/installer/setup/install.h" 5 #include "chrome/installer/setup/install.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 // manifest. Required arguments, in order, are: 385 // manifest. Required arguments, in order, are:
386 // - Localized display name for the product. 386 // - Localized display name for the product.
387 // - Relative path to the VisualElements directory, three times. 387 // - Relative path to the VisualElements directory, three times.
388 static const char kManifestTemplate[] = 388 static const char kManifestTemplate[] =
389 "<Application " 389 "<Application "
390 "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" 390 "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n"
391 " <VisualElements\r\n" 391 " <VisualElements\r\n"
392 " ShowNameOnSquare150x150Logo='on'\r\n" 392 " ShowNameOnSquare150x150Logo='on'\r\n"
393 " Square150x150Logo='%ls\\Logo.png'\r\n" 393 " Square150x150Logo='%ls\\Logo.png'\r\n"
394 " Square70x70Logo='%ls\\SmallLogo.png'\r\n" 394 " Square70x70Logo='%ls\\SmallLogo.png'\r\n"
395 " Square44x44Logo='%ls\\SmallLogo.png'\r\n"
395 " ForegroundText='light'\r\n" 396 " ForegroundText='light'\r\n"
396 " BackgroundColor='#323232'/>\r\n" 397 " BackgroundColor='#212121'/>\r\n"
397 "</Application>\r\n"; 398 "</Application>\r\n";
398 399
399 const base::string16 manifest_template( 400 const base::string16 manifest_template(
400 base::ASCIIToUTF16(kManifestTemplate)); 401 base::ASCIIToUTF16(kManifestTemplate));
401 402
402 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( 403 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution(
403 BrowserDistribution::CHROME_BROWSER); 404 BrowserDistribution::CHROME_BROWSER);
404 // TODO(grt): http://crbug.com/75152 Write a reference to a localized 405 // TODO(grt): http://crbug.com/75152 Write a reference to a localized
405 // resource for |display_name|. 406 // resource for |display_name|.
406 base::string16 display_name(dist->GetDisplayName()); 407 base::string16 display_name(dist->GetDisplayName());
407 EscapeXmlAttributeValueInSingleQuotes(&display_name); 408 EscapeXmlAttributeValueInSingleQuotes(&display_name);
408 409
409 // Fill the manifest with the desired values. 410 // Fill the manifest with the desired values.
410 base::string16 manifest16(base::StringPrintf( 411 base::string16 manifest16(base::StringPrintf(
411 manifest_template.c_str(), elements_dir.c_str(), elements_dir.c_str())); 412 manifest_template.c_str(), elements_dir.c_str(), elements_dir.c_str()));
grt (UTC plus 2) 2016/06/20 19:43:04 one more ", elements_dir.c_str()" for the new subs
scottmg 2016/06/20 21:10:24 Oof, thanks! Done.
412 413
413 // Write the manifest to |src_path|. 414 // Write the manifest to |src_path|.
414 const std::string manifest(base::UTF16ToUTF8(manifest16)); 415 const std::string manifest(base::UTF16ToUTF8(manifest16));
415 int size = base::checked_cast<int>(manifest.size()); 416 int size = base::checked_cast<int>(manifest.size());
416 if (base::WriteFile( 417 if (base::WriteFile(
417 src_path.Append(installer::kVisualElementsManifest), 418 src_path.Append(installer::kVisualElementsManifest),
418 manifest.c_str(), size) == size) { 419 manifest.c_str(), size) == size) {
419 VLOG(1) << "Successfully wrote " << installer::kVisualElementsManifest 420 VLOG(1) << "Successfully wrote " << installer::kVisualElementsManifest
420 << " to " << src_path.value(); 421 << " to " << src_path.value();
421 return true; 422 return true;
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 // Read master_preferences copied beside chrome.exe at install. 779 // Read master_preferences copied beside chrome.exe at install.
779 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); 780 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs));
780 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); 781 base::FilePath chrome_exe(installation_root.Append(kChromeExe));
781 CreateOrUpdateShortcuts( 782 CreateOrUpdateShortcuts(
782 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); 783 chrome_exe, chrome, prefs, CURRENT_USER, install_operation);
783 784
784 UpdateDefaultBrowserBeaconForPath(chrome_exe); 785 UpdateDefaultBrowserBeaconForPath(chrome_exe);
785 } 786 }
786 787
787 } // namespace installer 788 } // namespace installer
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/setup/install_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698