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_win.h" | 5 #include "chrome/browser/shell_integration_win.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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 new IsPinnedToTaskbarHelper(error_callback, result_callback); | 480 new IsPinnedToTaskbarHelper(error_callback, result_callback); |
481 } | 481 } |
482 | 482 |
483 IsPinnedToTaskbarHelper::IsPinnedToTaskbarHelper( | 483 IsPinnedToTaskbarHelper::IsPinnedToTaskbarHelper( |
484 const ErrorCallback& error_callback, | 484 const ErrorCallback& error_callback, |
485 const ResultCallback& result_callback) | 485 const ResultCallback& result_callback) |
486 : shell_handler_( | 486 : shell_handler_( |
487 l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_SHELL_HANDLER_NAME)), | 487 l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_SHELL_HANDLER_NAME)), |
488 error_callback_(error_callback), | 488 error_callback_(error_callback), |
489 result_callback_(result_callback) { | 489 result_callback_(result_callback) { |
| 490 DCHECK(error_callback_); |
| 491 DCHECK(result_callback_); |
| 492 |
490 // |shell_handler_| owns the callbacks and is guaranteed to be destroyed | 493 // |shell_handler_| owns the callbacks and is guaranteed to be destroyed |
491 // before |this|, therefore making base::Unretained() safe to use. | 494 // before |this|, therefore making base::Unretained() safe to use. |
492 shell_handler_.set_error_callback(base::Bind( | 495 shell_handler_.set_error_callback(base::Bind( |
493 &IsPinnedToTaskbarHelper::OnConnectionError, base::Unretained(this))); | 496 &IsPinnedToTaskbarHelper::OnConnectionError, base::Unretained(this))); |
494 shell_handler_.set_disable_sandbox(); | 497 shell_handler_.set_disable_sandbox(); |
495 shell_handler_.Start(); | 498 shell_handler_.Start(); |
496 | 499 |
497 shell_handler_.service()->IsPinnedToTaskbar( | 500 shell_handler_.service()->IsPinnedToTaskbar( |
498 base::Bind(&IsPinnedToTaskbarHelper::OnIsPinnedToTaskbarResult, | 501 base::Bind(&IsPinnedToTaskbarHelper::OnIsPinnedToTaskbarResult, |
499 base::Unretained(this))); | 502 base::Unretained(this))); |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 if (base::PathExists(shortcut)) | 894 if (base::PathExists(shortcut)) |
892 return shortcut; | 895 return shortcut; |
893 } | 896 } |
894 | 897 |
895 return base::FilePath(); | 898 return base::FilePath(); |
896 } | 899 } |
897 | 900 |
898 } // namespace win | 901 } // namespace win |
899 | 902 |
900 } // namespace shell_integration | 903 } // namespace shell_integration |
OLD | NEW |