| 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 // This file defines functions that integrate Chrome in Windows shell. These | 5 // This file defines functions that integrate Chrome in Windows shell. These |
| 6 // functions can be used by Chrome as well as Chrome installer. All of the | 6 // functions can be used by Chrome as well as Chrome installer. All of the |
| 7 // work is done by the local functions defined in anonymous namespace in | 7 // work is done by the local functions defined in anonymous namespace in |
| 8 // this class. | 8 // this class. |
| 9 | 9 |
| 10 #include "chrome/installer/util/shell_util.h" | 10 #include "chrome/installer/util/shell_util.h" |
| (...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2438 const base::FilePath& icon_path, | 2438 const base::FilePath& icon_path, |
| 2439 const std::set<base::string16>& file_extensions) { | 2439 const std::set<base::string16>& file_extensions) { |
| 2440 ScopedVector<RegistryEntry> entries; | 2440 ScopedVector<RegistryEntry> entries; |
| 2441 | 2441 |
| 2442 // Create a class for this app. | 2442 // Create a class for this app. |
| 2443 RegistryEntry::ApplicationInfo app_info; | 2443 RegistryEntry::ApplicationInfo app_info; |
| 2444 app_info.prog_id = prog_id; | 2444 app_info.prog_id = prog_id; |
| 2445 app_info.file_type_name = file_type_name; | 2445 app_info.file_type_name = file_type_name; |
| 2446 app_info.file_type_icon_path = icon_path.value(); | 2446 app_info.file_type_icon_path = icon_path.value(); |
| 2447 app_info.file_type_icon_index = 0; | 2447 app_info.file_type_icon_index = 0; |
| 2448 app_info.command_line = command_line.GetCommandLineString(); | 2448 app_info.command_line = command_line.GetCommandLineStringWithPlaceholders(); |
| 2449 RegistryEntry::GetProgIdEntries(app_info, &entries); | 2449 RegistryEntry::GetProgIdEntries(app_info, &entries); |
| 2450 | 2450 |
| 2451 // Associate each extension that the app can handle with the class. Set this | 2451 // Associate each extension that the app can handle with the class. Set this |
| 2452 // app as the default handler if and only if there is no existing default. | 2452 // app as the default handler if and only if there is no existing default. |
| 2453 for (std::set<base::string16>::const_iterator it = file_extensions.begin(); | 2453 for (std::set<base::string16>::const_iterator it = file_extensions.begin(); |
| 2454 it != file_extensions.end(); | 2454 it != file_extensions.end(); |
| 2455 ++it) { | 2455 ++it) { |
| 2456 // Do not allow empty file extensions, or extensions beginning with a '.'. | 2456 // Do not allow empty file extensions, or extensions beginning with a '.'. |
| 2457 DCHECK(!it->empty()); | 2457 DCHECK(!it->empty()); |
| 2458 DCHECK_NE(L'.', (*it)[0]); | 2458 DCHECK_NE(L'.', (*it)[0]); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2477 base::string16 key_path(ShellUtil::kRegClasses); | 2477 base::string16 key_path(ShellUtil::kRegClasses); |
| 2478 key_path.push_back(base::FilePath::kSeparators[0]); | 2478 key_path.push_back(base::FilePath::kSeparators[0]); |
| 2479 key_path.append(prog_id); | 2479 key_path.append(prog_id); |
| 2480 return InstallUtil::DeleteRegistryKey( | 2480 return InstallUtil::DeleteRegistryKey( |
| 2481 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); | 2481 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); |
| 2482 | 2482 |
| 2483 // TODO(mgiuca): Remove the extension association entries. This requires that | 2483 // TODO(mgiuca): Remove the extension association entries. This requires that |
| 2484 // the extensions associated with a particular prog_id are stored in that | 2484 // the extensions associated with a particular prog_id are stored in that |
| 2485 // prog_id's key. | 2485 // prog_id's key. |
| 2486 } | 2486 } |
| OLD | NEW |