Chromium Code Reviews| 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/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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 message.append("Start menu "); | 80 message.append("Start menu "); |
| 81 break; | 81 break; |
| 82 default: | 82 default: |
| 83 NOTREACHED(); | 83 NOTREACHED(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 message.push_back('"'); | 86 message.push_back('"'); |
| 87 if (properties.has_shortcut_name()) | 87 if (properties.has_shortcut_name()) |
| 88 message.append(UTF16ToUTF8(properties.shortcut_name)); | 88 message.append(UTF16ToUTF8(properties.shortcut_name)); |
| 89 else | 89 else |
| 90 message.append(UTF16ToUTF8(dist->GetAppShortCutName())); | 90 message.append(UTF16ToUTF8(dist->GetDisplayName())); |
|
huangs
2013/05/21 21:35:41
I don't think we should localize our logs. Please
gab
2013/05/21 21:46:45
grt@ started this a while back, I forget his argum
| |
| 91 message.push_back('"'); | 91 message.push_back('"'); |
| 92 | 92 |
| 93 message.append(" shortcut to "); | 93 message.append(" shortcut to "); |
| 94 message.append(UTF16ToUTF8(properties.target.value())); | 94 message.append(UTF16ToUTF8(properties.target.value())); |
| 95 if (properties.has_arguments()) | 95 if (properties.has_arguments()) |
| 96 message.append(UTF16ToUTF8(properties.arguments)); | 96 message.append(UTF16ToUTF8(properties.arguments)); |
| 97 | 97 |
| 98 if (properties.pin_to_taskbar && | 98 if (properties.pin_to_taskbar && |
| 99 base::win::GetVersion() >= base::win::VERSION_WIN7) { | 99 base::win::GetVersion() >= base::win::VERSION_WIN7) { |
| 100 message.append(" and pinning to the taskbar."); | 100 message.append(" and pinning to the taskbar."); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 " <SplashScreen Image='%2$ls\\splash-620x300.png'/>\r\n" | 323 " <SplashScreen Image='%2$ls\\splash-620x300.png'/>\r\n" |
| 324 " </VisualElements>\r\n" | 324 " </VisualElements>\r\n" |
| 325 "</Application>"; | 325 "</Application>"; |
| 326 | 326 |
| 327 const string16 manifest_template(ASCIIToUTF16(kManifestTemplate)); | 327 const string16 manifest_template(ASCIIToUTF16(kManifestTemplate)); |
| 328 | 328 |
| 329 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( | 329 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( |
| 330 BrowserDistribution::CHROME_BROWSER); | 330 BrowserDistribution::CHROME_BROWSER); |
| 331 // TODO(grt): http://crbug.com/75152 Write a reference to a localized | 331 // TODO(grt): http://crbug.com/75152 Write a reference to a localized |
| 332 // resource for |display_name|. | 332 // resource for |display_name|. |
| 333 string16 display_name(dist->GetAppShortCutName()); | 333 string16 display_name(dist->GetDisplayName()); |
| 334 EscapeXmlAttributeValueInSingleQuotes(&display_name); | 334 EscapeXmlAttributeValueInSingleQuotes(&display_name); |
| 335 | 335 |
| 336 // Fill the manifest with the desired values. | 336 // Fill the manifest with the desired values. |
| 337 string16 manifest16(base::StringPrintf(manifest_template.c_str(), | 337 string16 manifest16(base::StringPrintf(manifest_template.c_str(), |
| 338 display_name.c_str(), | 338 display_name.c_str(), |
| 339 elements_dir.c_str())); | 339 elements_dir.c_str())); |
| 340 | 340 |
| 341 // Write the manifest to |src_path|. | 341 // Write the manifest to |src_path|. |
| 342 const std::string manifest(UTF16ToUTF8(manifest16)); | 342 const std::string manifest(UTF16ToUTF8(manifest16)); |
| 343 if (file_util::WriteFile( | 343 if (file_util::WriteFile( |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 689 if (app_host_path.empty()) | 689 if (app_host_path.empty()) |
| 690 return false; | 690 return false; |
| 691 | 691 |
| 692 CommandLine cmd(app_host_path); | 692 CommandLine cmd(app_host_path); |
| 693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); | 693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); |
| 694 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); | 694 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); |
| 695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
| 696 } | 696 } |
| 697 | 697 |
| 698 } // namespace installer | 698 } // namespace installer |
| OLD | NEW |