Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chrome/browser/shell_integration_win.cc

Issue 2581473002: DCHECK for a valid error callback callback in GetIsPinnedToTaskbarState (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/welcome_win10_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/welcome_win10_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698