| 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 DCHECK(task_runner_->BelongsToCurrentThread()); | 636 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 637 delete this; | 637 delete this; |
| 638 } | 638 } |
| 639 | 639 |
| 640 void SettingsAppMonitor::Context::Initialize( | 640 void SettingsAppMonitor::Context::Initialize( |
| 641 base::SingleThreadTaskRunner* task_runner, | 641 base::SingleThreadTaskRunner* task_runner, |
| 642 scoped_refptr<base::SequencedTaskRunner> monitor_runner, | 642 scoped_refptr<base::SequencedTaskRunner> monitor_runner, |
| 643 const base::WeakPtr<SettingsAppMonitor>& monitor) { | 643 const base::WeakPtr<SettingsAppMonitor>& monitor) { |
| 644 // This and all other methods must be called on the automation thread. | 644 // This and all other methods must be called on the automation thread. |
| 645 DCHECK(task_runner->BelongsToCurrentThread()); | 645 DCHECK(task_runner->BelongsToCurrentThread()); |
| 646 DCHECK(!monitor_runner->RunsTasksOnCurrentThread()); | 646 DCHECK(!monitor_runner->RunsTasksInCurrentSequence()); |
| 647 | 647 |
| 648 task_runner_ = task_runner; | 648 task_runner_ = task_runner; |
| 649 monitor_runner_ = monitor_runner; | 649 monitor_runner_ = monitor_runner; |
| 650 monitor_ = monitor; | 650 monitor_ = monitor; |
| 651 | 651 |
| 652 HRESULT result = automation_.CreateInstance(CLSID_CUIAutomation, nullptr, | 652 HRESULT result = automation_.CreateInstance(CLSID_CUIAutomation, nullptr, |
| 653 CLSCTX_INPROC_SERVER); | 653 CLSCTX_INPROC_SERVER); |
| 654 if (SUCCEEDED(result)) | 654 if (SUCCEEDED(result)) |
| 655 result = automation_ ? InstallObservers() : E_FAIL; | 655 result = automation_ ? InstallObservers() : E_FAIL; |
| 656 | 656 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 delegate_->OnPromoFocused(); | 835 delegate_->OnPromoFocused(); |
| 836 } | 836 } |
| 837 | 837 |
| 838 void SettingsAppMonitor::OnPromoChoiceMade(bool accept_promo) { | 838 void SettingsAppMonitor::OnPromoChoiceMade(bool accept_promo) { |
| 839 DCHECK(thread_checker_.CalledOnValidThread()); | 839 DCHECK(thread_checker_.CalledOnValidThread()); |
| 840 delegate_->OnPromoChoiceMade(accept_promo); | 840 delegate_->OnPromoChoiceMade(accept_promo); |
| 841 } | 841 } |
| 842 | 842 |
| 843 } // namespace win | 843 } // namespace win |
| 844 } // namespace shell_integration | 844 } // namespace shell_integration |
| OLD | NEW |