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

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

Issue 151101: Fixit: Remove bunch of coverity warnings from chrome/installer/*. (Closed)
Patch Set: Created 11 years, 5 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 | « chrome/installer/gcapi/gcapi.cc ('k') | chrome/installer/setup/uninstall.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <shlobj.h> 5 #include <shlobj.h>
6 #include <time.h> 6 #include <time.h>
7 7
8 #include "chrome/installer/setup/install.h" 8 #include "chrome/installer/setup/install.h"
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 15 matching lines...) Expand all
26 #include "chrome/installer/util/work_item.h" 26 #include "chrome/installer/util/work_item.h"
27 #include "chrome/installer/util/version.h" 27 #include "chrome/installer/util/version.h"
28 #include "chrome/installer/util/work_item_list.h" 28 #include "chrome/installer/util/work_item_list.h"
29 29
30 // Build-time generated include file. 30 // Build-time generated include file.
31 #include "installer_util_strings.h" 31 #include "installer_util_strings.h"
32 #include "registered_dlls.h" 32 #include "registered_dlls.h"
33 33
34 namespace { 34 namespace {
35 35
36 std::wstring AppendPath(const std::wstring parent_path, 36 std::wstring AppendPath(const std::wstring& parent_path,
37 const std::wstring path) { 37 const std::wstring& path) {
38 std::wstring new_path(parent_path); 38 std::wstring new_path(parent_path);
39 file_util::AppendToPath(&new_path, path); 39 file_util::AppendToPath(&new_path, path);
40 return new_path; 40 return new_path;
41 } 41 }
42 42
43 void AddChromeToMediaPlayerList() { 43 void AddChromeToMediaPlayerList() {
44 std::wstring reg_path(installer::kMediaPlayerRegPath); 44 std::wstring reg_path(installer::kMediaPlayerRegPath);
45 // registry paths can also be appended like file system path 45 // registry paths can also be appended like file system path
46 file_util::AppendToPath(&reg_path, installer_util::kChromeExe); 46 file_util::AppendToPath(&reg_path, installer_util::kChromeExe);
47 LOG(INFO) << "Adding Chrome to Media player list at " << reg_path; 47 LOG(INFO) << "Adding Chrome to Media player list at " << reg_path;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 HMODULE module = GetModuleHandle(L"kernel32.dll"); 272 HMODULE module = GetModuleHandle(L"kernel32.dll");
273 WOW_FUNC p = reinterpret_cast<WOW_FUNC>(GetProcAddress(module, 273 WOW_FUNC p = reinterpret_cast<WOW_FUNC>(GetProcAddress(module,
274 "IsWow64Process")); 274 "IsWow64Process"));
275 if ((p != NULL) && (!(p)(handle, &is64) || (is64 != FALSE))) { 275 if ((p != NULL) && (!(p)(handle, &is64) || (is64 != FALSE))) {
276 return true; 276 return true;
277 } 277 }
278 278
279 return false; 279 return false;
280 } 280 }
281 281
282 void RegisterChromeOnMachine(std::wstring install_path, int options) { 282 void RegisterChromeOnMachine(const std::wstring& install_path, int options) {
283 bool system_level = (options & installer_util::SYSTEM_LEVEL) != 0; 283 bool system_level = (options & installer_util::SYSTEM_LEVEL) != 0;
284 // Try to add Chrome to Media Player shim inclusion list. We don't do any 284 // Try to add Chrome to Media Player shim inclusion list. We don't do any
285 // error checking here because this operation will fail if user doesn't 285 // error checking here because this operation will fail if user doesn't
286 // have admin rights and we want to ignore the error. 286 // have admin rights and we want to ignore the error.
287 AddChromeToMediaPlayerList(); 287 AddChromeToMediaPlayerList();
288 288
289 // We try to register Chrome as a valid browser on local machine. This 289 // We try to register Chrome as a valid browser on local machine. This
290 // will work only if current user has admin rights. 290 // will work only if current user has admin rights.
291 std::wstring chrome_exe(install_path); 291 std::wstring chrome_exe(install_path);
292 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe); 292 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 546 }
547 547
548 std::wstring installer::GetInstallerPathUnderChrome( 548 std::wstring installer::GetInstallerPathUnderChrome(
549 const std::wstring& install_path, const std::wstring& new_version) { 549 const std::wstring& install_path, const std::wstring& new_version) {
550 std::wstring installer_path(install_path); 550 std::wstring installer_path(install_path);
551 file_util::AppendToPath(&installer_path, new_version); 551 file_util::AppendToPath(&installer_path, new_version);
552 file_util::AppendToPath(&installer_path, installer_util::kInstallerDir); 552 file_util::AppendToPath(&installer_path, installer_util::kInstallerDir);
553 return installer_path; 553 return installer_path;
554 } 554 }
555 555
OLDNEW
« no previous file with comments | « chrome/installer/gcapi/gcapi.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698