chrome/browser/profiles/profile_shortcut_manager_win.cc
// Populates |paths| with the file paths of Chrome desktop shortcuts that have
// the specified |command_line|. If |include_empty_command_lines| is true,
// Chrome desktop shortcuts with empty command lines will also be included.
Populates |paths| with the file paths of Chrome desktop shortcuts that have
the specified |command_line|. If |include_empty_command_lines| is true,
Chrome desktop shortcuts with empty command lines will also be included.
Populates |paths| with the file paths of Chrome desktop shortcuts that have the specified |command_line| . If |include_empty_command_lines| is true Chrome desktop shortcuts with empty command lines will also be included .
void ListDesktopShortcutsWithCommandLine(const FilePath& chrome_exe,
                                         const string16& command_line,
                                         bool include_empty_command_lines,
                                         std::vector<FilePath>* paths) {
  FilePath shortcuts_directory;
  if (!GetDesktopShortcutsDirectory(&shortcuts_directory))
    return;
  file_util::FileEnumerator enumerator(shortcuts_directory, false,
      file_util::FileEnumerator::FILES);
  for (FilePath path = enumerator.Next(); !path.empty();
       path = enumerator.Next()) {
    string16 shortcut_command_line;
    if (!IsChromeShortcut(path, chrome_exe, &shortcut_command_line))
      continue;
    if ((shortcut_command_line.empty() && include_empty_command_lines) ||
        (shortcut_command_line.find(command_line) != string16::npos)) {
      paths->push_back(path);
    }
  }
}
void ListDesktopShortcutsWithCommandLine ( const FilePath & chrome_exe , const string16 & command_line , bool include_empty_command_lines , std :: vector < FilePath > * paths ) { FilePath shortcuts_directory ; if ( ! GetDesktopShortcutsDirectory ( & shortcuts_directory ) ) return ; file_util :: FileEnumerator enumerator ( shortcuts_directory , false , file_util :: FileEnumerator :: FILES ) ; for ( FilePath path = enumerator . Next ( ) ; ! path . empty ( ) ; path = enumerator . Next ( ) ) { string16 shortcut_command_line ; if ( ! IsChromeShortcut ( path , chrome_exe , & shortcut_command_line ) ) continue ; if ( ( shortcut_command_line . empty ( ) && include_empty_command_lines ) || ( shortcut_command_line . find ( command_line ) != string16 :: npos ) ) { paths -> push_back ( path ) ; } } }
Populates |paths| with the file paths of Chrome desktop shortcuts that have
the specified |command_line|.
Populates |paths| with the file paths of Chrome desktop shortcuts that have the specified |command_line| .
// TODO(asvitkine): Change this to build a CommandLine object and ensure all // args from |command_line| are present in the shortcut's CommandLine. This // will be more robust when |command_line| contains multiple args.