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> | 10 #include <propkey.h> |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 ShellUtil::kRegVistaUrlPrefs, KEY_READ); | 377 ShellUtil::kRegVistaUrlPrefs, KEY_READ); |
378 if (key.Valid() && (key.ReadValue(L"Progid", &app_cmd) == ERROR_SUCCESS) && | 378 if (key.Valid() && (key.ReadValue(L"Progid", &app_cmd) == ERROR_SUCCESS) && |
379 app_cmd == L"FirefoxURL") | 379 app_cmd == L"FirefoxURL") |
380 ff_default = true; | 380 ff_default = true; |
381 } else { | 381 } else { |
382 base::string16 key_path(L"http"); | 382 base::string16 key_path(L"http"); |
383 key_path.append(ShellUtil::kRegShellOpen); | 383 key_path.append(ShellUtil::kRegShellOpen); |
384 base::win::RegKey key(HKEY_CLASSES_ROOT, key_path.c_str(), KEY_READ); | 384 base::win::RegKey key(HKEY_CLASSES_ROOT, key_path.c_str(), KEY_READ); |
385 base::string16 app_cmd; | 385 base::string16 app_cmd; |
386 if (key.Valid() && (key.ReadValue(L"", &app_cmd) == ERROR_SUCCESS) && | 386 if (key.Valid() && (key.ReadValue(L"", &app_cmd) == ERROR_SUCCESS) && |
387 base::string16::npos != StringToLowerASCII(app_cmd).find(L"firefox")) | 387 base::string16::npos != |
| 388 base::StringToLowerASCII(app_cmd).find(L"firefox")) |
388 ff_default = true; | 389 ff_default = true; |
389 } | 390 } |
390 return ff_default; | 391 return ff_default; |
391 } | 392 } |
392 | 393 |
393 base::string16 ShellIntegration::GetAppModelIdForProfile( | 394 base::string16 ShellIntegration::GetAppModelIdForProfile( |
394 const base::string16& app_name, | 395 const base::string16& app_name, |
395 const base::FilePath& profile_path) { | 396 const base::FilePath& profile_path) { |
396 std::vector<base::string16> components; | 397 std::vector<base::string16> components; |
397 components.push_back(app_name); | 398 components.push_back(app_name); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 } | 577 } |
577 | 578 |
578 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + | 579 shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + |
579 installer::kLnkExt); | 580 installer::kLnkExt); |
580 if (base::PathExists(shortcut)) | 581 if (base::PathExists(shortcut)) |
581 return shortcut; | 582 return shortcut; |
582 } | 583 } |
583 | 584 |
584 return base::FilePath(); | 585 return base::FilePath(); |
585 } | 586 } |
OLD | NEW |