| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <shobjidl.h> | 8 #include <shobjidl.h> |
| 9 #include <propkey.h> | 9 #include <propkey.h> |
| 10 #include <propvarutil.h> | 10 #include <propvarutil.h> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "base/stringprintf.h" |
| 17 #include "base/task.h" | 18 #include "base/task.h" |
| 18 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 19 #include "base/win/registry.h" | 20 #include "base/win/registry.h" |
| 20 #include "base/win/scoped_comptr.h" | 21 #include "base/win/scoped_comptr.h" |
| 21 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
| 22 #include "chrome/browser/web_applications/web_app.h" | 23 #include "chrome/browser/web_applications/web_app.h" |
| 23 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/chrome_paths_internal.h" | 26 #include "chrome/common/chrome_paths_internal.h" |
| 26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 SLGP_RAWPATH)) || | 210 SLGP_RAWPATH)) || |
| 210 lstrcmpi(chrome_exe_.value().c_str(), source.c_str())) | 211 lstrcmpi(chrome_exe_.value().c_str(), source.c_str())) |
| 211 return false; | 212 return false; |
| 212 | 213 |
| 213 std::wstring arguments; | 214 std::wstring arguments; |
| 214 if (FAILED(shell_link->GetArguments(WriteInto(&arguments, MAX_PATH), | 215 if (FAILED(shell_link->GetArguments(WriteInto(&arguments, MAX_PATH), |
| 215 MAX_PATH))) | 216 MAX_PATH))) |
| 216 return false; | 217 return false; |
| 217 | 218 |
| 218 // Get expected app id from shortcut command line. | 219 // Get expected app id from shortcut command line. |
| 219 CommandLine command_line = CommandLine::FromString(StringPrintf( | 220 CommandLine command_line = CommandLine::FromString(base::StringPrintf( |
| 220 L"\"%ls\" %ls", source.c_str(), arguments.c_str())); | 221 L"\"%ls\" %ls", source.c_str(), arguments.c_str())); |
| 221 | 222 |
| 222 FilePath profile_path; | 223 FilePath profile_path; |
| 223 if (command_line.HasSwitch(switches::kUserDataDir)) { | 224 if (command_line.HasSwitch(switches::kUserDataDir)) { |
| 224 profile_path = | 225 profile_path = |
| 225 command_line.GetSwitchValuePath(switches::kUserDataDir).AppendASCII( | 226 command_line.GetSwitchValuePath(switches::kUserDataDir).AppendASCII( |
| 226 chrome::kInitialProfile); | 227 chrome::kInitialProfile); |
| 227 } | 228 } |
| 228 | 229 |
| 229 std::wstring app_name; | 230 std::wstring app_name; |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 profile_path); | 520 profile_path); |
| 520 } | 521 } |
| 521 | 522 |
| 522 void ShellIntegration::MigrateChromiumShortcuts() { | 523 void ShellIntegration::MigrateChromiumShortcuts() { |
| 523 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 524 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
| 524 return; | 525 return; |
| 525 | 526 |
| 526 BrowserThread::PostTask( | 527 BrowserThread::PostTask( |
| 527 BrowserThread::FILE, FROM_HERE, new MigrateChromiumShortcutsTask()); | 528 BrowserThread::FILE, FROM_HERE, new MigrateChromiumShortcutsTask()); |
| 528 } | 529 } |
| OLD | NEW |