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

Side by Side Diff: remoting/host/plugin/daemon_controller_win.cc

Issue 10695012: Addressing remaining Breakpad integration issues: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback and rebased. Created 8 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/host/usage_stats_consent_win.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 "remoting/host/plugin/daemon_controller.h" 5 #include "remoting/host/plugin/daemon_controller.h"
6 6
7 #include <objbase.h> 7 #include <objbase.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 callback.Run(UTF16ToUTF8( 636 callback.Run(UTF16ToUTF8(
637 string16(static_cast<BSTR>(version), version.Length()))); 637 string16(static_cast<BSTR>(version), version.Length())));
638 } 638 }
639 639
640 void DaemonControllerWin::DoGetUsageStatsConsent( 640 void DaemonControllerWin::DoGetUsageStatsConsent(
641 const GetUsageStatsConsentCallback& done) { 641 const GetUsageStatsConsentCallback& done) {
642 DCHECK(worker_thread_.message_loop_proxy()->BelongsToCurrentThread()); 642 DCHECK(worker_thread_.message_loop_proxy()->BelongsToCurrentThread());
643 643
644 // Activate the Daemon Controller and see if it supports |IDaemonControl2|. 644 // Activate the Daemon Controller and see if it supports |IDaemonControl2|.
645 HRESULT hr = ActivateController(); 645 HRESULT hr = ActivateController();
646 if (FAILED(hr) || control2_.get() == NULL) { 646 if (FAILED(hr)) {
647 // The host is not installed yet. Assume that the user's consent is not
648 // recorded yet and set the default value to true. This value will not come
649 // into effect until the user installs the host and agrees to crash
650 // dump reporting.
651 done.Run(true, true, false);
652 return;
653 }
654
655 if (control2_.get() == NULL) {
656 // The host is installed and does not support crash dump reporting.
647 done.Run(false, false, false); 657 done.Run(false, false, false);
648 return; 658 return;
649 } 659 }
650 660
651 // Get the recorded user's consent. 661 // Get the recorded user's consent.
652 BOOL allowed; 662 BOOL allowed;
653 BOOL set_by_policy; 663 BOOL set_by_policy;
654 hr = control2_->GetUsageStatsConsent(&allowed, &set_by_policy); 664 hr = control2_->GetUsageStatsConsent(&allowed, &set_by_policy);
655 if (FAILED(hr)) { 665 if (FAILED(hr)) {
656 // If the user's consent is not recorded yet, set the default value to true. 666 // If the user's consent is not recorded yet, set the default value to true.
657 // This value will not come into effect until the user agrees to crash 667 // This value will not come into effect until the user agrees to crash
658 // dump reporting while starting the host. 668 // dump reporting.
659 done.Run(true, true, false); 669 done.Run(true, true, false);
660 return; 670 return;
661 } 671 }
662 672
663 done.Run(true, !!allowed, !!set_by_policy); 673 done.Run(true, !!allowed, !!set_by_policy);
664 } 674 }
665 675
666 } // namespace 676 } // namespace
667 677
668 scoped_ptr<DaemonController> remoting::DaemonController::Create() { 678 scoped_ptr<DaemonController> remoting::DaemonController::Create() {
669 return scoped_ptr<DaemonController>(new DaemonControllerWin()); 679 return scoped_ptr<DaemonController>(new DaemonControllerWin());
670 } 680 }
671 681
672 } // namespace remoting 682 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/usage_stats_consent_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698