| 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/browser/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shlwapi.h> | 8 #include <shlwapi.h> |
| 9 #include <shobjidl.h> | 9 #include <shobjidl.h> |
| 10 #include <propkey.h> // Needs to come after shobjidl.h. | 10 #include <propkey.h> // Needs to come after shobjidl.h. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 base::win::RegKey cmd_key(HKEY_CLASSES_ROOT, | 212 base::win::RegKey cmd_key(HKEY_CLASSES_ROOT, |
| 213 cmd_key_path.c_str(), | 213 cmd_key_path.c_str(), |
| 214 KEY_READ); | 214 KEY_READ); |
| 215 size_t split_offset = url_spec.find(L':'); | 215 size_t split_offset = url_spec.find(L':'); |
| 216 if (split_offset == base::string16::npos) | 216 if (split_offset == base::string16::npos) |
| 217 return base::string16(); | 217 return base::string16(); |
| 218 const base::string16 parameters = url_spec.substr(split_offset + 1, | 218 const base::string16 parameters = url_spec.substr(split_offset + 1, |
| 219 url_spec.length() - 1); | 219 url_spec.length() - 1); |
| 220 base::string16 application_to_launch; | 220 base::string16 application_to_launch; |
| 221 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) { | 221 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) { |
| 222 ReplaceSubstringsAfterOffset(&application_to_launch, | 222 base::ReplaceSubstringsAfterOffset(&application_to_launch, |
| 223 0, | 223 0, |
| 224 L"%1", | 224 L"%1", |
| 225 parameters); | 225 parameters); |
| 226 return application_to_launch; | 226 return application_to_launch; |
| 227 } | 227 } |
| 228 return base::string16(); | 228 return base::string16(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 | 231 |
| 232 ShellIntegration::DefaultWebClientState | 232 ShellIntegration::DefaultWebClientState |
| 233 GetDefaultWebClientStateFromShellUtilDefaultState( | 233 GetDefaultWebClientStateFromShellUtilDefaultState( |
| 234 ShellUtil::DefaultState default_state) { | 234 ShellUtil::DefaultState default_state) { |
| 235 switch (default_state) { | 235 switch (default_state) { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 } | 576 } |
| 577 | 577 |
| 578 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + | 578 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + |
| 579 installer::kLnkExt); | 579 installer::kLnkExt); |
| 580 if (base::PathExists(shortcut)) | 580 if (base::PathExists(shortcut)) |
| 581 return shortcut; | 581 return shortcut; |
| 582 } | 582 } |
| 583 | 583 |
| 584 return base::FilePath(); | 584 return base::FilePath(); |
| 585 } | 585 } |
| OLD | NEW |