| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/win/settings_app_monitor.h" | 5 #include "chrome/browser/win/settings_app_monitor.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlcom.h> | 8 #include <atlcom.h> |
| 9 #include <oleauto.h> | 9 #include <oleauto.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 DCHECK(task_runner_->BelongsToCurrentThread()); | 635 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 636 delete this; | 636 delete this; |
| 637 } | 637 } |
| 638 | 638 |
| 639 void SettingsAppMonitor::Context::Initialize( | 639 void SettingsAppMonitor::Context::Initialize( |
| 640 base::SingleThreadTaskRunner* task_runner, | 640 base::SingleThreadTaskRunner* task_runner, |
| 641 scoped_refptr<base::SequencedTaskRunner> monitor_runner, | 641 scoped_refptr<base::SequencedTaskRunner> monitor_runner, |
| 642 const base::WeakPtr<SettingsAppMonitor>& monitor) { | 642 const base::WeakPtr<SettingsAppMonitor>& monitor) { |
| 643 // This and all other methods must be called on the automation thread. | 643 // This and all other methods must be called on the automation thread. |
| 644 DCHECK(task_runner->BelongsToCurrentThread()); | 644 DCHECK(task_runner->BelongsToCurrentThread()); |
| 645 DCHECK(!monitor_runner->RunsTasksOnCurrentThread()); | 645 DCHECK(!monitor_runner->RunsTasksInCurrentSequence()); |
| 646 | 646 |
| 647 task_runner_ = task_runner; | 647 task_runner_ = task_runner; |
| 648 monitor_runner_ = monitor_runner; | 648 monitor_runner_ = monitor_runner; |
| 649 monitor_ = monitor; | 649 monitor_ = monitor; |
| 650 | 650 |
| 651 HRESULT result = automation_.CreateInstance(CLSID_CUIAutomation, nullptr, | 651 HRESULT result = automation_.CreateInstance(CLSID_CUIAutomation, nullptr, |
| 652 CLSCTX_INPROC_SERVER); | 652 CLSCTX_INPROC_SERVER); |
| 653 if (SUCCEEDED(result)) | 653 if (SUCCEEDED(result)) |
| 654 result = automation_ ? InstallObservers() : E_FAIL; | 654 result = automation_ ? InstallObservers() : E_FAIL; |
| 655 | 655 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 delegate_->OnPromoFocused(); | 833 delegate_->OnPromoFocused(); |
| 834 } | 834 } |
| 835 | 835 |
| 836 void SettingsAppMonitor::OnPromoChoiceMade(bool accept_promo) { | 836 void SettingsAppMonitor::OnPromoChoiceMade(bool accept_promo) { |
| 837 DCHECK(thread_checker_.CalledOnValidThread()); | 837 DCHECK(thread_checker_.CalledOnValidThread()); |
| 838 delegate_->OnPromoChoiceMade(accept_promo); | 838 delegate_->OnPromoChoiceMade(accept_promo); |
| 839 } | 839 } |
| 840 | 840 |
| 841 } // namespace win | 841 } // namespace win |
| 842 } // namespace shell_integration | 842 } // namespace shell_integration |
| OLD | NEW |